Need Help For Anti Team Kill
#8

OnPlayerSpawn:
pawn Код:
SetPlayerTeam(playerid, 1); // If the player with the team 1 shoots another player in team 1, no damage will be conflicted.
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(GetPlayerTeam(playerid) == GetPlayerTeam(issuerid))
    {
       new Float:health, Float:arm;
       if(GetPlayerArmour(playerid) > 0)
       {
            GetPlayerArmour(playerid, arm);
            SetPlayerArmour(playerid, floatadd(arm, amount));
       }
       else
       {
            GetPlayerHealth(playerid, health);
            SetPlayerHealth(playerid, floatadd(health, amount));
        }
        return 1;
}
You also don't need to do this function as Neonman said, SetPlayerTeam doesn't allow you to harm another player on that team.
Reply


Messages In This Thread
Need Help For Anti Team Kill - by WhiteAngels - 17.04.2014, 10:14
Re : Need Help For Anti Team Kill - by S4t3K - 17.04.2014, 10:23
Re: Re : Need Help For Anti Team Kill - by WhiteAngels - 17.04.2014, 10:55
Re: Re : Need Help For Anti Team Kill - by WhiteAngels - 17.04.2014, 10:58
Re: Need Help For Anti Team Kill - by AdytzaSS - 17.04.2014, 11:00
Re: Need Help For Anti Team Kill - by Astralis - 17.04.2014, 11:18
Re: Need Help For Anti Team Kill - by WhiteAngels - 17.04.2014, 11:32
Re: Need Help For Anti Team Kill - by Firewire - 17.04.2014, 11:35
Re: Need Help For Anti Team Kill - by WhiteAngels - 18.04.2014, 05:43
Re: Need Help For Anti Team Kill - by AdytzaSS - 18.04.2014, 06:00

Forum Jump:


Users browsing this thread: 2 Guest(s)