how do i make a cooldown for anti cmd spam?
#2

ZCMD example:

PHP код:
new AntiSpam[MAX_PLAYERS];
public 
OnPlayerCommandReceived(playeridcmdtext[])
{
    if(
AntiSpam[playerid]-gettime() > 0)
    {
        
SendClientMessage(playeridCOLOR_RED"ERROR: Don't spam. Wait before using another command.");
        return 
0;
    }
    
AntiSpam[playerid] = gettime() + 1// cooldown (in seconds)
    
return 1;

Reply


Messages In This Thread
how do i make a cooldown for anti cmd spam? - by div - 19.06.2018, 02:34
Re: how do i make a cooldown for anti cmd spam? - by kovac - 19.06.2018, 02:45
Re: how do i make a cooldown for anti cmd spam? - by Gameluner - 19.06.2018, 03:38

Forum Jump:


Users browsing this thread: 1 Guest(s)