Team damage / 2, How to do this?
#6

Try(but preserve your actual code cus I didnt test this):

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if (GodMode[playerid] == 1)
    {
        SetPlayerHealth(playerid, 0x7F800000);
    }
    else
    {
        if(issuerid != INVALID_PLAYER_ID)
        {
            if (gTeam[playerid] == gTeam[issuerid])
            {
                new Float:Health,Float:Armour;
                GetPlayerHealth(playerid,Health);
                GetPlayerArmour(playerid,Armour);
                if(amount < Health+Armour) //avoid double kill for playerid
                {
                    if(Armour>0.0) {
                        Armour -= amount/2.0;
                        if(Armour < 0.0) Health += Armour;
                    }
                    else {
                        Health -= amount/2.0;
                    }
                    SetPlayerArmour(playerid,(Armour>0)?(Armour):(0.0));
                    SetPlayerHealth(playerid, Health);
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Team damage / 2, How to do this? - by AnthonyTimmers - 15.02.2014, 20:00
Re: Team damage / 2, How to do this? - by redneckvideogamer - 15.02.2014, 20:14
Re: Team damage / 2, How to do this? - by AnthonyTimmers - 15.02.2014, 20:23
Re: Team damage / 2, How to do this? - by redneckvideogamer - 15.02.2014, 20:36
Re: Team damage / 2, How to do this? - by AnthonyTimmers - 16.02.2014, 00:37
Re: Team damage / 2, How to do this? - by CyNiC - 16.02.2014, 00:52
Re: Team damage / 2, How to do this? - by AnthonyTimmers - 16.02.2014, 09:06
Re: Team damage / 2, How to do this? - by CyNiC - 16.02.2014, 12:24

Forum Jump:


Users browsing this thread: 1 Guest(s)