22.08.2012, 09:19
if you compare a player-saved timestamp with the GetTickCount, then its a good idea to change the == to a >=
this prevents the function execution to at least 4 ms in between. do you want a delay of 4 seconds btw? if so, change the 4 to 4000 - its milliseconds.
pawn Код:
if(variable[playerid] != 0)
{
// Functions here
if(GetTickCount() - TimeTickCount[playerid] >= 4000)
{
TimeTickCount[playerid] = GetTickCount();//save the new servertime after the command: the player has to wait 4 seconds in order to pass the second command execution
// Functions here
return 1;
}
return 1;
}