26.06.2013, 09:46
SetTimer causes lag, why you don't use better gettime instead? You just need to create a variable for saving the time, when the player has used.
Then add this top of your cmd, where if(RobPossible == 1) is.
pawn Код:
new g_RobTimer[MAX_PLAYERS]
pawn Код:
g_RobTimer[playerid] = gettime(); // Use this, when the /rob command worked successfully for the player.
pawn Код:
if( (gettime() - g_RobTimer[playerid]) > 300 )
{
// Rob command
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now!");
}