Quote:
Originally Posted by varthshenon
Just like dowster said. You can use GetTime,timer.
You have to make a boolean that check if it's already 10 minutes or not.
pawn Код:
new bool:already[MAX_PLAYERS]
forward enough(playerid);
CMD:blow(playerid,params[]) { if(already[playerid] == false) return SendClientMessage(playerid,somecolor,"You have to wait 10 minutes"); CreateExplosion(...............);//Just like what Nero_3D said. already[playerid] = true; SetTimerEx("enough",600000,0,"d",playerid); return 1; }
public enough(playerid) { already[playerid] = false; return 1; }
|
i have heard that using too many timers may be slow, i was thinking something like having the array be
Код:
LastExplodeTime[playerid]
and the check be
Код:
if (LastExplodeTime[playerid] > (GetTime() - 600)) SendClientMessage(playerid, 0xFF000000, "You have already used an explosion in the last ten minutes")