Jump to content

Source


Drakath

Recommended Posts

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 ?

Link to comment
  
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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...