PDA

View Full Version : Need Little help in Anti-Team kill


iOmar
09/05/2012, 11:30 AM
Guys i did this.But i still can kill my team members. I need seriously help.

public SetTeamToPlayer(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == TEAM_INDIA) { SetPlayerTeam(playerid, 0); }
else if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerTeam(playerid, 1); }
else if(gTeam[playerid] == TEAM_USA) { SetPlayerTeam(playerid, 2); }
else if(gTeam[playerid] == TEAM_RUSSIA) { SetPlayerTeam(playerid, 3); }
else if(gTeam[playerid] == TEAM_PAKISTAN) { SetPlayerTeam(playerid, 4); }
}
return 1;
}

Ballu Miaa
09/05/2012, 12:39 PM
Here you go Haseeb.

1. Add this under 'public OnPlayerSpawn(playerid)' callback of your game mode.
SetTeamToPlayer(playerid);
2. Add this on the bottom of your game mode.

forward SetTeamToPlayer(playerid);
public SetTeamToPlayer(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == TEAM_INDIA) return SetPlayerTeam(playerid, TEAM_INDIA);
else if(gTeam[playerid] == TEAM_GERMANY) return SetPlayerTeam(playerid, TEAM_GERMANY);
else if(gTeam[playerid] == TEAM_USA) return SetPlayerTeam(playerid, TEAM_USA);
else if(gTeam[playerid] == TEAM_RUSSIA) return SetPlayerTeam(playerid, TEAM_RUSSIA);
else if(gTeam[playerid] == TEAM_PAKISTAN) return SetPlayerTeam(playerid, TEAM_PAKISTAN);
}
return 1;
}

iOmar
09/05/2012, 01:21 PM
I'll check and Then tell u. Any way thanks