11.11.2010, 04:05
i see each line is a class id so will have to be like this
have fun
pawn Код:
#define TEAM_ROBBERS 0
#define TEAM_POLICE 1
#define TEAM_SWAT 2
#define TEAM_ARMY 3
#define TEAM_ROBBERS_COLOUR 0xFFFFFFAA // White
#define TEAM_POLICE_COLOUR 0x0000FFAA // Blue
#define TEAM_SWAT_COLOUR 0x800080AA // Purple
#define TEAM_ARMY_COLOUR 0x33AA33AA // Green
new gTeam[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
stock SetPlayerTeamFromClass(playerid, classid){
if(classid == 0 || classid == 1 || classid == 2 || classid == 3)gTeam[playerid] = TEAM_ROBBERS;
else if(classid == 4 || classid == 5 || classid == 6 || classid == 7)gTeam[playerid] = TEAM_POLICE;
else if(classid == 8)gTeam[playerid] = TEAM_SWAT;
else if(classid == 9)gTeam[playerid] = TEAM_ARMY;
SetPlayerToTeamColour(playerid);
}
stock SetPlayerToTeamColour(playerid){
if(gTeam[playerid] == TEAM_ROBBERS)SetPlayerColor(playerid,TEAM_ROBBERS_COLOUR);
else if(gTeam[playerid] == TEAM_POLICE)SetPlayerColor(playerid,TEAM_POLICE_COLOUR);
else if(gTeam[playerid] == TEAM_SWAT)SetPlayerColor(playerid,TEAM_SWAT_COLOUR);
else if(gTeam[playerid] == TEAM_ARMY)SetPlayerColor(playerid,TEAM_ARMY_COLOUR);
}