Anti team-attack
#8

You have to add something like this to OnPlayerSpawn:

if(PlayerInfo[playerid][pMember] == 1) gTeam[playerid] = 1;
or with skins: if(GetPlayerSkin(playerid) == 121) gTeam[playerid] = 1;
You have to do this for all the gangs.

After that you use OnPlayerTakeDamage like Facerafter said:
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(gTeam[playerid] == gTeam[issuerid])
        {
            new Float:health, Float:newhealth;
            health = GetPlayerHealth(playerid, health);
            newhealth = health += amount;
            SetPlayerHealth(playerid, newhealth);
        }
    }
}
Reply


Messages In This Thread
Anti team-attack - by TheSnaKe - 09.06.2013, 11:14
Re: Anti team-attack - by Guest123 - 09.06.2013, 11:35
Re: Anti team-attack - by Facerafter - 09.06.2013, 11:51
Re: Anti team-attack - by Vince - 09.06.2013, 12:20
Re: Anti team-attack - by TheSnaKe - 09.06.2013, 12:22
Re: Anti team-attack - by Facerafter - 09.06.2013, 12:29
Re: Anti team-attack - by TheSnaKe - 09.06.2013, 12:42
Re: Anti team-attack - by Aly - 09.06.2013, 12:54
Re: Anti team-attack - by TheSnaKe - 09.06.2013, 13:10
Re: Anti team-attack - by dEcooR - 09.06.2013, 13:41

Forum Jump:


Users browsing this thread: 2 Guest(s)