Jump to content

Chat block 5 sec


Laysiks

Recommended Posts

Can some one help me ? I have this but this itsnt working.It's shows on chat outputChatBox and my message.

  
addEventHandler("onPlayerChat",root,function () 
if getElementData(source,"blokadaspam") then 
cancelEvent() 
outputChatBox("Poczekaj na następną wiadomość",source,255,255,255,true) 
else 
setElementData(source,"blokadaspam",true) 
setTimer(function () setElementData(source,"blokadaspam", false) end,5000,1) 
end 
end) 

Link to comment

Try using this (Not Tested)

local spammers = { } 
addEventHandler ( "onPlayerChat", root, function ( )  
    if ( spammers [ source ] and spammers [ source ] > getTickCount ( ) ) then  
        outputChatBox ( "Poczekaj na następną wiadomość", source, 255, 255, 255 ) 
        cancelEvent ( ) 
        return  
    end  
    spammers [ source ] = getTickCount ( ) + 5000 
end ) 
  

Link to comment
antiSpam = {} 
function antiChatSpam()  
    if isTimer(antiSpam[source]) then  
        cancelEvent()   
        outputChatBox("DO NOT SPAM", source, 255, 255, 0) 
    else 
        antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source)  
                 
    end 
end 
addEventHandler("onPlayerChat", root, antiChatSpam)  

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