Damage System [Armor & Health]
#3

Try this:

pawn Код:
if(GetPlayerWeapon(Shooter) == 31)
{
    new Float:H, Float:A, Float:N;
    GetPlayerArmour(Target, A);
    GetPlayerHealth(Target, H);

    if(A >= 30) //if Armour is bigger or equal than 30
    {
        GetPlayerArmour(Target, A);
        SetPlayerArmour(Target, A-30); //if Armour is 30, then the result will be 0 so its ok
    }
    else if(A == 0)
    {
        GetPlayerHealth(Target, H);
        SetPlayerHealth(Target, H-30);
    }
    else if(A < 30) //if Armour is smaller than 30
    {
        N = 29 - A //the maximum number here is 29, so if we minus the Armour from 29, we will save the difference into N
        SetPlayerArmour(Target, 0); //setting armour into 0
        GetPlayerHealth(Target, H );
        SetPlayerHealth(Target, H-N); //minus the differnce
    }
}
I dont test it, but i think will work.
Reply


Messages In This Thread
Damage System [Armor & Health] - by maiky1499 - 01.02.2013, 09:50
Re: Damage System [Armor & Health] - by maiky1499 - 02.02.2013, 10:24
Re: Damage System [Armor & Health] - by ]Rafaellos[ - 02.02.2013, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)