How to set health
#8

Like Rajat said, the chance is really small to get exactly 1 hp.
You can better us a range of like 1-15 hp, with other words:

Quote:

new Float: health;
GetPlayerHealth(playerid, health);
if(health <= 10)
{
//code
}

You can use something like this in OnPlayerTakeDamage or in a timer, in OnPlayerTakeDamage it's better, since you will use less memory then...

At the part of //code you can use SetPlayerHealth(playerid, 999999), so the player gets godmode. Apart from that you can then use the rest of your code, like: /acceptdeath etc.

Good luck
Reply


Messages In This Thread
How to set health - by REVO-RP - 19.01.2013, 11:22
Re: How to set health - by Goldino - 19.01.2013, 11:23
Re: How to set health - by captainjohn - 19.01.2013, 11:25
Re: How to set health - by REVO-RP - 19.01.2013, 11:25
Re: How to set health - by REVO-RP - 19.01.2013, 11:28
Re: How to set health - by RajatPawar - 19.01.2013, 11:29
Re: How to set health - by captainjohn - 19.01.2013, 11:33
Re: How to set health - by Baboon - 19.01.2013, 11:33
Re: How to set health - by REVO-RP - 19.01.2013, 11:48
Re: How to set health - by captainjohn - 19.01.2013, 12:00

Forum Jump:


Users browsing this thread: 2 Guest(s)