19.03.2012, 21:00
Quote:
Hello, How can i make it that if the player's hp is on a certain point it starts to automatically loses by 5 pts or something?
|
PHP код:
new Float:Health, hptimer;
GetPlayerHealth(playerid,Health);
PHP код:
If(Health < 20)
{
hptimer = SetTimer("losehp",1000,true); //calls the timer every second
}
PHP код:
public hptimer(playerid)
{
SetPlayerHealth(playerid, Health -5); //player loses 5hp each time the timer is called.
}
PHP код:
KillTimer hptimer; //kills timer