Timer help - 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 help (
/showthread.php?tid=222527)
Timer help -
boyan96 - 07.02.2011
How i can set timer for command. I lont to put timer on this command /givearmour when one player heal after 2 minutes to can heal again
Re: Timer help - Unknown123 - 07.02.2011
pawn Код:
//On Top
new HealedPlayerRecently[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("HealedPlayerRecently",120000,1);
return 1;
}
//Put this in your /heal command
HealedPlayerRecently[playerid] = 1;
forward HealedPlayerRecent();
public HealedPlayerRecent()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(HealedPlayerRecently[i] == 1)
{
HealedPlayerRecently[i] = 0;
}
}
}