Jump to content

[Help] Error with Anti_Spam


Atouk

Recommended Posts

I want to increase you the number of times you can talk in some time (SPAM), Nose if I understand, but I hope you understand me. Below the script.

antiSpam = {}  
function antiChatSpam()  
    if isTimer(antiSpam[source]) then 
        cancelEvent()   
        outputChatBox("#ffffff"..getPlayerName(source).." #ff6600ha sido muteado -->[Razon #3] ! ( 60 segundos )", 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) 
  
  
function autoUnmute ( player ) 
    if ( isElement ( player ) and isPlayerMuted ( player ) ) then 
        setPlayerMuted ( player, false ) 
        outputChatBox ("#FFFFFF"..getPlayerName ( player ).." #ff6600ha sido desmuteado !",getRootElement(), 255, 255, 0,true ) 
    end 
end 

I hope answers, thanks.

Link to comment
antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) 

To increase the antiSpam timer, change the '1000' argument for a time more longer.

e.g:

antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 2000, 1, source) 

'2000' Is 2 seconds.

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...