16.08.2009, 22:22
Hello, I have a script that disables people from teamkilling, it works on everyone but ID 0..
I dont know why, but heres the script.
How can I fix this?
I dont know why, but heres the script.
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
if (gTeam[playerid] == TEAM_TRIAD)
{
SetPlayerTeam(playerid, TEAM_TRIAD);
}
else if (gTeam[playerid] == TEAM_CASINO)
{
SetPlayerTeam(playerid, TEAM_CASINO);
}
else if (gTeam[playerid] == TEAM_POLICE)
{
SetPlayerTeam(playerid, TEAM_POLICE);
}
else if (gTeam[playerid] == TEAM_MAFIA)
{
SetPlayerTeam(playerid, TEAM_MAFIA);
}
else if (gTeam[playerid] == TEAM_ARMY)
{
SetPlayerTeam(playerid, TEAM_ARMY);
}
else if (gTeam[playerid] == TEAM_REDNECK)
{
SetPlayerTeam(playerid, TEAM_REDNECK);
}
else if (gTeam[playerid] == TEAM_PILOT)
{
SetPlayerTeam(playerid, TEAM_PILOT);
}
else if (gTeam[playerid] == TEAM_RAIL)
{
SetPlayerTeam(playerid, TEAM_RAIL);
}
else if (gTeam[playerid] == TEAM_ADMIN && IsPlayerAdmin(playerid))
{
SetPlayerTeam(playerid, TEAM_ADMIN);
GivePlayerWeapon(playerid, 46, 500);
}
else
{
SendClientMessage(playerid,COLOR_RED,"You're not an Administrator! Choose another team!");
SetPlayerHealth(playerid, 0.0);
ForceClassSelection(playerid);
}
return 1;
}