07.11.2010, 16:21
I used some coding for coloured teams. The problem is when i want to have the colors:
Robbers = White
Police = Blue
Swat = Purple
Army = Green
Here is the code:
What do i need to do/change to make sure that when you choose a skin that you end up with the color of that team?
Robbers = White
Police = Blue
Swat = Purple
Army = Green
Here is the code:
Код:
#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) { SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = TEAM_ROBBERS; } if(classid == 1) { gTeam[playerid] = TEAM_POLICE; } if(classid == 2) { gTeam[playerid] = TEAM_SWAT; } else if(classid == 3) { gTeam[playerid] = TEAM_ARMY; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == TEAM_ROBBERS) { SetPlayerColor(playerid,TEAM_ROBBERS_COLOUR); } if(gTeam[playerid] == TEAM_POLICE) { SetPlayerColor(playerid,TEAM_POLICE_COLOUR); } if(gTeam[playerid] == TEAM_SWAT) { SetPlayerColor(playerid,TEAM_SWAT_COLOUR); } if(gTeam[playerid] == TEAM_ARMY) { SetPlayerColor(playerid,TEAM_ARMY_COLOUR); } }