12.11.2009, 14:33
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
static
playerTick[MAX_PLAYERS];
new
tick = GetTickCount();
if (abs(playerTick[playerid] - tick) < 1000)
{
SendClientMessage(playerid, 0xFF0000FF, "Флудераст!");
Kick(playerid);
return 1;
}
else
{
playerTick[playerid] = tick;
}
// далее команды
}
Если нету abs:
pawn Code:
#define abs(%1) \
((%1 < 0) ? (-(%1)) : (%1))