TotalHealth+Armor
#1

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
     new Float:health;
     GetPlayerHealth(playerid, health);
        if(weaponid == 7)
   SetPlayerHealth(playerid,health-10);
        if(weaponid == 8)
   SetPlayerHealth(playerid,health-10);
        if(weaponid == 4)
   SetPlayerHealth(playerid,health-30);
        if(weaponid == 3)
   SetPlayerHealth(playerid,health-11);
        if(weaponid == 5)
   SetPlayerHealth(playerid,health-11);
     if(weaponid == 23)
   SetPlayerHealth(playerid,health-20);
        if(weaponid == 24)
   SetPlayerHealth(playerid,health-70);
        if(weaponid == 22)
   SetPlayerHealth(playerid,health-20);
        if(weaponid == 25)
   SetPlayerHealth(playerid,health-60);
        if(weaponid == 26)
   SetPlayerHealth(playerid,health-48);
        if(weaponid == 27)
   SetPlayerHealth(playerid,health-100);
        if(weaponid == 28)
   SetPlayerHealth(playerid,health-30);
        if(weaponid == 29)
   SetPlayerHealth(playerid,health-35);
        if(weaponid == 30)
   SetPlayerHealth(playerid,health-42);
        if(weaponid == 31)
   SetPlayerHealth(playerid,health-48);
        if(weaponid == 32)
   SetPlayerHealth(playerid,health-32);
        if(weaponid == 33)
   SetPlayerHealth(playerid,health-40);
        if(weaponid == 34)
   SetPlayerHealth(playerid,health-100);
        if(weaponid == 33)
   SetPlayerHealth(playerid,health-40);
        if(weaponid == 33) SetPlayerHealth(playerid,health-40);
    }
    return 1;
}
This is the code now I want to change this:
Код:
 SetPlayerHealth(playerid,health-40);
to this
Код:
 SetPlayerHealth(playerid,TotalHealth-40);
for example.

that if I'm shooting someone it will give him -40 from his health and his armor together..

currently, if a player has 100% armor, and 100% HP, and the code is
Код:
 SetPlayerHealth(playerid,health-40);
so it will lower his armor as the weapon lowering default, and it will lower the health -40.

which mean according to this idiot system: a player can die with 0 HP and 50 armor.

I want it to low his total health, like if he got armor 100 and HP 100 so it will lower -40 from his armor first.

Kind of a problem, does anyone knows what can I do? I'm a begginer, do not expect me for a lot.
Reply


Messages In This Thread
TotalHealth+Armor - by slerox - 10.06.2012, 20:25
Re: TotalHealth+Armor - by Jefff - 10.06.2012, 22:17
Re: TotalHealth+Armor - by slerox - 11.06.2012, 09:20
Re: TotalHealth+Armor - by iggy1 - 11.06.2012, 09:39
Re: TotalHealth+Armor - by slerox - 11.06.2012, 11:30
Re: TotalHealth+Armor - by slerox - 11.06.2012, 11:56
Re: TotalHealth+Armor - by Private200 - 11.06.2012, 11:58

Forum Jump:


Users browsing this thread: 1 Guest(s)