28.11.2013, 05:44
(
Последний раз редактировалось SlonCHL; 28.11.2013 в 06:30.
)
I have this script which doesn't work and I don't know why it makes the health goes 100 everytime it is set
Is it the calculation problem? Can we set a decimal-ed number as a player's health?
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(weaponid == 39 || weaponid == 27 || weaponid == 28 || weaponid == 33 || weaponid == 36 || weaponid == 37 || weaponid == 38 || weaponid == 41)
{
new Float:CashDamage = 10/100*amount;
new Float:PHealth;
GetPlayerHealth(playerid, PHealth);
PHealth = PHealth-CashDamage;
SetPlayerHealth(playerid, PHealth);
}
}