22.03.2017, 20:11
I made a quick code and I do not know if it works or not as I haven't tried it yet;
It should go for RemovePlayerHealth(playerid, XXX); instead of SetPlayerHealth.
pawn Код:
stock RemovePlayerHealth(playerid, Float:damage)
{
new Float:pHealth, Float:pArmour, Float:remArmour, Float:exArmour;
GetPlayerHealth(playerid, pHealth);
GetPlayerArmour(playerid, pArmour);
if(pArmour > 0)
{
if(damage > pArmour)
{
exArmour = damage - pArmour;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, pHealth-exArmour);
}
else if(pArmour > damage)
{
remArmour = pArmour - damage;
SetPlayerArmour(playerid, remArmour)
}
}
}