24.07.2012, 17:57
That won't work like this.
Try:
On TOP:
OnPlayerConnect:
OnPlayerCommandText:
At Bottom:
Cheers.
Try:
On TOP:
pawn Код:
new LastCmd[MAX_PLAYERS];
pawn Код:
LastCmd[playerid] = 0;
pawn Код:
if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xFF0000FF, "* {6EF83C}You can only use commands once {F81414}every two seconds.");
return 1;
}
LastCmd[playerid] = gettime();
pawn Код:
stock IsPlayerFlooding(playerid)
{
if(LastCmd[playerid] + 2 > gettime()) return 1; //Flooding: Yes
else return 0; //Flooding: No
}