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

Hi,

That's one way. Another system is to make a timer for the player, which disables the variable. And of course check if the variable is enabled on the Command start.
Ex. not for copying:
Код:
new bool:AS[MAX_PLAYERS_EX];

forward asas(playerid);
public asas(playerid) {
    AS[playerid] = false;
    return 1;
}

public OnPlayerCommand(playerid,.......) {
    if(!AS[playerid]) {
        SCM(playerid,...);
        return 0;
    }
     if(!strcmp,....) {
         // Ur codes
         AS[playerid] = true;
         SetTimer("asas",1500,0);
    }
     return 0;
}
Hope you understood.

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