adithegman Posted April 28, 2013 Share Posted April 28, 2013 hello guys, i have a problem with the anti-spam and hope you guys can solve it it outputChatBox well cuz' i see for ex Adithegman has been muted... but it doesn't mute me for 1 min, i can still speak note: this is server-side antiSpam = {} function antiChatSpam() if isTimer(antiSpam[source]) then cancelEvent() outputChatBox("#ffffff"..getPlayerName(source).." has been #ff0000muted #fffffffor for 60 seconds, reason: #ff0000spam", getRootElement(), 255, 255, 0,true) setPlayerMuted ( source, true ) setTimer ( autoUnmute, 60000, 1, source) else antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) end end addEventHandler("onPlayerChat", root, antiChatSpam) local commandSpam = {} function preventCommandSpam( command ) if command == "say" then if (not commandSpam[source]) then commandSpam[source] = 1 elseif (commandSpam[source] == 5) then cancelEvent() outputChatBox("#ffffff"..getPlayerName(source).." has been #ff0000muted #fffffffor for 60 seconds, reason: #ff0000spam!", getRootElement(), 255, 255, 0,true) setPlayerMuted( source, true ) setTimer ( autoUnmute, 60000, 1, source) else commandSpam[source] = commandSpam[source] + 1 end end end addEventHandler("onPlayerCommand", root, preventCommandSpam) setTimer(function() commandSpam = {} end, 1000, 0) function autoUnmute ( source ) setPlayerMuted ( source, false ) end Link to comment
iPrestege Posted April 28, 2013 Share Posted April 28, 2013 Add this to admin group in ur acl.xml file : "resource.You're resource name"> Link to comment
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