[HELP] Weapon Damages
#6

I made a quick code and I do not know if it works or not as I haven't tried it yet;

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)
        }
    }
}
It should go for RemovePlayerHealth(playerid, XXX); instead of SetPlayerHealth.
Reply


Messages In This Thread
[HELP] Weapon Damages - by oSAINTo - 22.03.2017, 19:54
Re: [HELP] Weapon Damages - by Toroi - 22.03.2017, 19:56
Re: [HELP] Weapon Damages - by oSAINTo - 22.03.2017, 20:00
Re: [HELP] Weapon Damages - by Toroi - 22.03.2017, 20:01
Re: [HELP] Weapon Damages - by oSAINTo - 22.03.2017, 20:04
Re: [HELP] Weapon Damages - by Private200 - 22.03.2017, 20:11
Re: [HELP] Weapon Damages - by Toroi - 22.03.2017, 20:33

Forum Jump:


Users browsing this thread: 1 Guest(s)