Timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timer (
/showthread.php?tid=137141)
Timer -
Steven82 - 27.03.2010
How to put a command on a timer so you can only do it every hour?
Re: Timer -
Zimon95 - 27.03.2010
Using an array and SetTimerEx function.
pawn Code:
//on top
new CommandUsed[MAX_PLAYERS];
forward CommandDelay(playerid);
//On command...
CommandUsed[playerid] = 1;
SetTimerEx("CommandDelay",3600000, false, "i", playerid);
if(CommandUsed[playerid] == 1) reuturn //SendClient...
//somewhere else
public CommandDelay(playerid)
{
CommandUsed[playerid] = 0;
return 1;
}
Re: Timer -
Steven82 - 27.03.2010
so could i use this as a welfare check?