koragg Posted July 5, 2017 Posted July 5, 2017 (edited) 1 hour ago, 50cent said: Lol, now i have a new problem. The script working, but sometimes the /asay xy command does not working, wtf?! When i restart the resource many times then working again, but just for a few minutes, and does not working again. Wtf, how to fix this problem? No idea. Give debug errors/warnings. Edited July 5, 2017 by koragg
Gordon_G Posted July 5, 2017 Posted July 5, 2017 (edited) local names = { ["Admin"] = "Tulajdonos", ["Moderator"] = "Moderátor" } function adminuzi(thePlayer, commandName, ...) for i,v in pairs(getElementsByType( "player" )) do for group, serverGroupName in pairs( names ) do if isGuestAccount( getPlayerAccount( v ) ) then return end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group ) then local message = table.concat({...}, " ") outputChatBox("#0088FF["..serverGroupName.."]#d8001f "..getPlayerName(v)..":"..message,getRootElement(),0,0,0,true) break end end end end addCommandHandler("asay", adminuzi) Juste the thing I gave you, but "break" will stop the "for" loop. It should'nt spam anymore @50cent Edited July 5, 2017 by Gordon_G
Tokio Posted July 5, 2017 Author Posted July 5, 2017 26 minutes ago, koragg said: No idea. Give debug errors/warnings. no errors/warnings
Tokio Posted July 5, 2017 Author Posted July 5, 2017 2 hours ago, Gordon_G said: local names = { ["Admin"] = "Tulajdonos", ["Moderator"] = "Moderátor" } function adminuzi(thePlayer, commandName, ...) for i,v in pairs(getElementsByType( "player" )) do for group, serverGroupName in pairs( names ) do if isGuestAccount( getPlayerAccount( v ) ) then return end if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group ) then local message = table.concat({...}, " ") outputChatBox("#0088FF["..serverGroupName.."]#d8001f "..getPlayerName(v)..":"..message,getRootElement(),0,0,0,true) break end end end end addCommandHandler("asay", adminuzi) Juste the thing I gave you, but "break" will stop the "for" loop. It should'nt spam anymore @50cent this is not good, because output the text with all player's name..
itHyperoX Posted July 5, 2017 Posted July 5, 2017 (edited) getPlayerName(thePlayer) "v" is all player.. Edited July 5, 2017 by TheMOG
Tokio Posted July 5, 2017 Author Posted July 5, 2017 1 minute ago, TheMOG said: getPlayerName(thePlayer) "v" is all player.. here also change the "v"? if isGuestAccount( getPlayerAccount( v ) )
Tokio Posted July 5, 2017 Author Posted July 5, 2017 Just now, TheMOG said: no I changed the "v" to this getPlayerName(thePlayer), and now flood the text with my name, how to fix this?
Tokio Posted July 5, 2017 Author Posted July 5, 2017 11 minutes ago, koragg said: Use my code from first page. i used, but sometimes does not working the cmd
koragg Posted July 5, 2017 Posted July 5, 2017 10 minutes ago, 50cent said: i used, but sometimes does not working the cmd Well it's better than a fully non-working one anyway Hope someone can help you, I don't know why it doesn't work from time to time. And nothing in debug...
Tokio Posted July 5, 2017 Author Posted July 5, 2017 31 minutes ago, koragg said: Well it's better than a fully non-working one anyway Hope someone can help you, I don't know why it doesn't work from time to time. And nothing in debug... Now i tested on a localhost server, and on localhost server working fine everytime, and just on hosted server not working everytime
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now