oben
new gTeam [MAX_PLAYERS];
#define Army 0x00FF00C8 Farbe
#define Terror 0x804000C8 Farbe
#define TEAM_Army 3
#define TEAM_Terror 4
onplayerrequest Change to SetPlayerTeamFromClass
forward SetPlayerTeamFromClass(playerid,classid);
public SetPlayerTeamFromClass(playerid,classid)
{
SetPlayerPos(playerid, 1951.6893,1342.9749,15.3746);
SetPlayerCameraPos(playerid, 1954.0903,1343.1116,15.3746);
SetPlayerFacingAngle (playerid, 272.4016);
SetPlayerCameraLookAt(playerid, 1951.6893,1342.9749,15.3746);
if(classid == 0)
{
gTeam[playerid] = TEAM_Army;
SetPlayerColor(playerid, Army);
return 1;
}
else if(classid == 1)
{
gTeam[playerid] = TEAM_Army;
return 1;
}
else if(classid == 2)
{
gTeam[playerid] = TEAM_Terror;
return 1;
}
else if(classid == 3)
{
gTeam[playerid] = TEAM_Terror;
return 1;
}
return 1;
}
OnPlayerSpawn
public OnPlayerSpawn(playerid)
{
if (gTeam[playerid] == TEAM_Army)
{
SetPlayerColor(playerid, Army);
}
else if (gTeam[playerid] == TEAM_Army)
{
SetPlayerColor(playerid, Terror);
}
return 1;
}