Drakath Posted October 17, 2013 Posted October 17, 2013 function lolz(thePlayer) if spam then outputChatBox("dont spam",thePlayer,255,0,0) return end outputChatBox("works",root,0,255,0) spam = true setTimer(function() spam = false end,30000,1) end addCommandHandler("yup", lolz) How do I make anti-spam function for source ?
Markeloff Posted October 17, 2013 Posted October 17, 2013 local Spam = {} function lolz(thePlayer) if ( Spam[thePlayer] ) and ( getTickCount()-Spam[thePlayer] < 30000 ) then outputChatBox("Stop spamming",root,0,255,0) else Spam[thePlayer] = getTickCount() outputChatBox("works",root,0,255,0) end addCommandHandler("yup", lolz) Not tested but try it. Some people want it to happen, some wish it would happen, others make it happen.
Castillo Posted October 17, 2013 Posted October 17, 2013 You have a missing 'end'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Markeloff Posted October 17, 2013 Posted October 17, 2013 Yeah Some people want it to happen, some wish it would happen, others make it happen.
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