There is prolly better solutions for this one, but this will at least work.
When you want the health to stay at 20hp, call the healthtimer function, which is:
void healthtimer(string &in asTimer)
{
AddTimer("healthtimer", 5.0f, "healthtimer");
if (GetPlayerHealth() >= 20)
{
SetPlayerHealth(20.0f);
}
}
When you want the health to regain by itself again, just use RemoveTimer("healthtimer");
(Note that the healthtimer will not remove the auto regain of health, it will just modify the players' health so it will be near 20hp all the time.)
.
(07-29-2012, 10:11 PM)shadowZgamerZ Wrote: About 2) I mean that when player gets damage (about 80)- 100 - 80 = 20. So he has 20 energy left. I want to energy stay like that, i want it not to increase to 100 (full health - all good) again. So player cannot regain healt by just standing and waiting!