#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); } }
#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)gTeam[playerid] = TEAM_ROBBERS;
else if(classid == 1)gTeam[playerid] = TEAM_POLICE;
else if(classid == 2)gTeam[playerid] = TEAM_SWAT;
else if(classid == 3)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);
}
Doesn't work I was looking for:
Robbers = White Police = Blue Swat = Purple Army = Green |
how is it not working? |
more info are they the wrong colours all together or the right colours but for the wrong team? do you only have 4 player classes? |
AddPlayerClass(105,2502.9766,-1682.0063,13.5469,23.6501,0,0,0,0,0,0); // TEAM_ROBBERS 0 AddPlayerClass(104,2502.9766,-1682.0063,13.5469,23.6501,0,0,0,0,0,0); // TEAM_ROBBERS 0 AddPlayerClass(115,2502.9766,-1682.0063,13.5469,23.6501,0,0,0,0,0,0); // TEAM_ROBBERS 0 AddPlayerClass(116,2502.9766,-1682.0063,13.5469,23.6501,0,0,0,0,0,0); // TEAM_ROBBERS 0 AddPlayerClass(265,1587.1246,-1685.5427,6.2252,227.7512,0,0,0,0,0,0); // TEAM_POLICE 1 AddPlayerClass(266,1587.1246,-1685.5427,6.2252,227.7512,0,0,0,0,0,0); // TEAM_POLICE 1 AddPlayerClass(267,1587.1246,-1685.5427,6.2252,227.7512,0,0,0,0,0,0); // TEAM_POLICE 1 AddPlayerClass(280,1587.1246,-1685.5427,6.2252,227.7512,0,0,0,0,0,0); // TEAM_POLICE 1 AddPlayerClass(285,1587.1246,-1685.5427,6.2252,227.7512,0,0,0,0,0,0); // TEAM_SWAT 2 AddPlayerClass(287,1587.1246,-1685.5427,6.2252,227.7512,0,0,0,0,0,0); // TEAM_ARMY 3
#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);
}
i see each line is a class id so will have to be like this pawn 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) { 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 == 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_CO LOUR); else if(gTeam[playerid] == TEAM_SWAT)SetPlayerColor(playerid,TEAM_SWAT_COLOUR ); else if(gTeam[playerid] == TEAM_ARMY)SetPlayerColor(playerid,TEAM_ARMY_COLOUR ); } have fun |