09.06.2013, 12:54
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:
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);
}
}
}