03.12.2012, 19:05
I wish to deduct HP. For example, if a player does something, I want 60 hp points to be deducted from him.
I know it's not SetPlayerHealth... or is it?
I know it's not SetPlayerHealth... or is it?
new Float:HP;// You can change the fload name from HP to what ever.
GetPlayerHealth(playerid, HP); //We're saving it to our new Float:HP variable.
SetPlayerHealth(playerid, (HP- 60));
new Float:hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, (hp - 60 >= 0) ? (hp - 60) : 0);