Killing a timer
#6

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.

pawn Код:
new g_RobTimer[MAX_PLAYERS]
pawn Код:
g_RobTimer[playerid] = gettime(); // Use this, when the /rob command worked successfully for the player.
Then add this top of your cmd, where if(RobPossible == 1) is.

pawn Код:
if( (gettime() - g_RobTimer[playerid]) > 300 )
{
    // Rob command
}
else
{
    SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now!");
}
Reply


Messages In This Thread
Killing a timer - by Josh_Main - 26.06.2013, 05:17
Re: Killing a timer - by Alternative112 - 26.06.2013, 05:24
Re: Killing a timer - by Josh_Main - 26.06.2013, 05:28
Re: Killing a timer - by Josh_Main - 26.06.2013, 05:52
Re: Killing a timer - by Cjgogo - 26.06.2013, 07:10
AW: Killing a timer - by Skimmer - 26.06.2013, 09:46

Forum Jump:


Users browsing this thread: 1 Guest(s)