Kill a timer within a function?
#3

Quote:
Originally Posted by [A]ndrei
Посмотреть сообщение
ok post what you need and POST THE SCRIPT so we can see what you need to add/delete from there please.
I just want to know how to kill a timer but here's the code then(it's my system to load your hp when you die on my rp server)i call this function on player spawn if the player is dead:
Код:
stock HospitalSpawn(playerid){
	new Timer:HospitalTimer;
	if(playerinfo[playerid][dead] == 2){
		HospitalTimer = SetTimerEx("HospitalLoad", 200, 1, "i", playerid);
	}
}
public HospitalLoad(playerid){
	if(playerinfo[playerid][health] < 100){
	GivePlayerHpEx(playerid, 1);
           }
            else{
  	KillTimer(HospitalTimer);
  	playerinfo[playerid][dead] = 1;//more code to spawn the player will be added here
           }
}
(hate the indentation in this site when you can't use [TAB], someone know a way to do it?)
Reply


Messages In This Thread
Kill a timer within a function? - by Ranama - 29.06.2012, 20:56
Re: Kill a timer within a function? - by [A]ndrei - 29.06.2012, 20:57
Re: Kill a timer within a function? - by Ranama - 29.06.2012, 21:04
Re: Kill a timer within a function? - by [KHK]Khalid - 29.06.2012, 21:08
Re: Kill a timer within a function? - by Ranama - 29.06.2012, 21:11
Re: Kill a timer within a function? - by [KHK]Khalid - 29.06.2012, 21:14
Re: Kill a timer within a function? - by AndreT - 29.06.2012, 21:24

Forum Jump:


Users browsing this thread: 1 Guest(s)