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