Question about Timers - 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)
+--- Thread: Question about Timers (
/showthread.php?tid=359888)
Question about Timers -
RenSoprano - 15.07.2012
I want to know how to make when someone die to make timer
where it take him every 1 min -3 hp
Re: Question about Timers -
GSRP - 15.07.2012
Under "OnPlayerDeath(playerid, killerid, reason)"
pawn Код:
SetTimerEx("namehere", 60000, true, "i", playerid); // You can replace "namehere" to anything you want.
Then you setup what the timer does, by doing this:
pawn Код:
forward namehere(playerid); // If you changed "namehere", change it here too.
public namehere(playerid) // And here
{
SetPlayerHealth(playerid, -3);
return 1;
}
I used to have something similar to this, and this is what I did, and it worked fine for me. If this is wrong, anyone, please feel free to correct me, but it should be right, as this is what I used, till I removed this feature.