07.06.2009, 18:38
Here`s the correct code:
pawn Code:
#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
new gTeam[MAX_PLAYERS];
SetPlayerTeamFromClass(playerid)
{
new classid = GetPlayerSkin(playerid);
if (classid == 0)
{
gTeam[playerid] = TEAM_GROVE;
}
else
{
gTeam[playerid] = TEAM_BALLA;
}
return 1;
}
SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_GROVE)
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
else if (gTeam[playerid] == TEAM_BALLA)
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerTeamFromClass(playerid);
SetPlayerToTeamColor(playerid);
return 1;
}