Quote:
Originally Posted by Pandabeer1337
simply use a variable and a timer.
pawn Код:
forward antispam(playerid);
public OnPlayerCommandText(playerid, cmdtext) { if(spam[playerid] >=3) { SendClientMessage(playerid, RED, "Stop spamming wait 5 sec."); SetTimerEx("antispam", 30000, false, "i", playerid); } if(strcmp("/help", cmdtext, true)==0) { spam[playerid]++; } return 0; }
public antispam(playerid) { spam[playerid] = 0; SendClientMessage(playerid, RED,"you can now type a command"); return 1; }
not test / compiled,
|
uhm,i don't fet this code very vell... do I need to ad every my commands under OnPlayerCommandText? like /help .Credits ..etc ?