01.09.2009, 20:35
Hey, I'm using "SetPlayerTeam" and people can still teamkill sometimes...
Here's my code.
Why doesn't it work sometimes..?
Here's my code.
pawn Код:
public OnPlayerSpawn(playerid)
{
if (gTeam[playerid] == TEAM_TRIAD)
{
SetPlayerTeam(playerid, TEAM_TRIAD);
SetPlayerColor(playerid, COLOR_YELLOWGREEN);
}
else if (gTeam[playerid] == TEAM_CASINO)
{
SetPlayerTeam(playerid, TEAM_CASINO);
SetPlayerColor(playerid, COLOR_DARKORANGE);
}
else if (gTeam[playerid] == TEAM_POLICE)
{
SetPlayerTeam(playerid, TEAM_POLICE);
SetPlayerColor(playerid, COLOR_NAVY);
}
else if (gTeam[playerid] == TEAM_MAFIA)
{
SetPlayerTeam(playerid, TEAM_MAFIA);
SetPlayerColor(playerid, COLOR_MAGENTA);
}
else if (gTeam[playerid] == TEAM_ARMY)
{
SetPlayerTeam(playerid, TEAM_ARMY);
SetPlayerColor(playerid, COLOR_DARKGREEN);
}
else if (gTeam[playerid] == TEAM_REDNECK)
{
SetPlayerTeam(playerid, TEAM_REDNECK);
SetPlayerColor(playerid, COLOR_DARKRED);
}
else if (gTeam[playerid] == TEAM_PILOT)
{
SetPlayerTeam(playerid, TEAM_PILOT);
SetPlayerColor(playerid, COLOR_OLIVE);
}
else if (gTeam[playerid] == TEAM_RAIL)
{
SetPlayerTeam(playerid, TEAM_RAIL);
SetPlayerColor(playerid, COLOR_DARKKHAKI);
}
return 1;
}