Making Teams Problem
#1

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:
Код:
#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);
    }
}
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?
Reply


Messages In This Thread
Making Teams Problem - by Tessar - 07.11.2010, 16:21
Re: Making Teams Problem - by (SF)Noobanatior - 08.11.2010, 04:27
Re: Making Teams Problem - by Tessar - 09.11.2010, 15:10
Re: Making Teams Problem - by jonnyboy - 09.11.2010, 16:35
Re: Making Teams Problem - by (SF)Noobanatior - 09.11.2010, 17:09
Re: Making Teams Problem - by Tessar - 09.11.2010, 17:16
Re: Making Teams Problem - by (SF)Noobanatior - 10.11.2010, 04:10
Re: Making Teams Problem - by Tessar - 10.11.2010, 15:24
Re: Making Teams Problem - by (SF)Noobanatior - 11.11.2010, 04:05
Re: Making Teams Problem - by Tessar - 11.11.2010, 06:50

Forum Jump:


Users browsing this thread: 5 Guest(s)