18.06.2013, 22:51
This will return the amount of health that went over 100
This is just more simple just a limit so doesn't go over 100
pawn Код:
stock GivePlayerHealth(playerid,Amount)
{
new Float:health;
GetPlayerHealth(playerid,health);
new fcalc; fcalc = health + Amount;
if(fcalc > 100)
{
fcalc = fcalc - 100;
SetPlayerHealth(playerid,100);
return fcalc;
}else SetPlayerHealth(playerid,fcalc);
}
pawn Код:
stock GivePlayerHealth(playerid,Amount)
{
new Float:health;
GetPlayerHealth(playerid,health);
new fcalc; fcalc = health + Amount;
if(fcalc > 100) return SetPlayerHealth(playerid,100);
SetPlayerHealth(playerid,fcalc);
return 1;
}

