24.10.2009, 13:29
pawn Код:
new SmokeWait[MAX_PLAYERS];
forward SmokeTimer(playerid);
pawn Код:
if(SmokeWait[playerid] == 1) // If player has been smoking lately
{
SendClientMessage(playerid, 0xFFFFFFFF, "You have to wait before smoking again");
return 1;
}
SmokeWait[playerid] = 1; // Set this variable to 1 so player can't smoke next time
SetTimerEx("SmokeTimer", 120000, false, "i", playerid); // Timer to clear the variable after 2 minutes so player can smoke again
pawn Код:
public SmokeTimer(playerid)
{
SmokeWait[playerid] = 0; // Now player can smoke again
}

