06.08.2011, 16:55
Can someone help me how to create anti-command and anti-chat (anti-flood) spam using gettime(); function
(because SetTimer create lag)
(because SetTimer create lag)
new Spam[MAX_PLAYERS];//On top of your script
//Inside your command
if((GetTickCount() - Spam[playerid]) < 3000) return SendClientMessage(playerid,Rage_Red,"SPAMMER GTFO!");
Spam[playerid] = GetTickCount();
pawn Код:
|
new Spam[MAX_PLAYERS];//On top
//Inside your command
if((gettime() - Spam[playerid]) < 3) return SendClientMessage(playerid,-1,"You are spamming!");
Spam[playerid] = gettime();
new Spam[MAX_PLAYERS];
public OnPlayerCommandReceived(playerid,cmdtext[])
{
if((gettime() - Spam[playerid]) < 3)
{
SendClientMessage(playerid,-1,"You are spamming!");
return 0;
}
Spam[playerid] = gettime();
return 1;
}