Team Colour Not Working Help :(
#1

Ok Guys I need help in team colours Here is how it looks like
Код:
SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_POLICE)
	{
		SetPlayerColor(playerid,0x33CCFFAA);//Light Blue
	}
	else if (gTeam[playerid] == TEAM_EMERGENCY)
	{
		SetPlayerColor(playerid,0x33FF33AA);//Green
	}
	else if (gTeam[playerid] == TEAM_ADMINS)
	{
		SetPlayerColor(playerid,0xFFFFFFAA);//White
	}
	else if (gTeam[playerid] == TEAM_HOMELAND_SECURITY)
	{
		SetPlayerColor(playerid,0x33CCFFAA);
	}
	else if (gTeam[playerid] == TEAM_DESERT_EAGLES)
	{
		SetPlayerColor(playerid,0x33FF33AA);//Green2
	}
	else if (gTeam[playerid] == TEAM_CIVILIAN)
	{
		SetPlayerColor(playerid,0xFFFF00AA);//Yellow
	}
    else if (gTeam[playerid] == TEAM_CRIMINAL)
	{
		SetPlayerColor(playerid,0xFF0000AA);//Red
	}
}
But the color is automatic not what I want What`s the problem?
I thinks there is problem with team thing
Код:
//----------------------------------------------------------------------------//
#define TEAM_POLICE 1
#define TEAM_EMERGENCY 2
#define TEAM_ADMINS 3
#define TEAM_HOMELAND_SECURITY 4
#define TEAM_DESERT_EAGLES 5
#define TEAM_CIVILIAN 6
#define TEAM_CRIMINAL 7
//----------------------------------------------------------------------------//
new gTeam[MAX_PLAYERS];
//----------------------------------------------------------------------------//
SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_POLICE;
	}
	else if (classid == 1)
	{
		gTeam[playerid] = TEAM_EMERGENCY;
	}
	else if (classid == 2)
	{
		gTeam[playerid] = TEAM_ADMINS;
	}
	else if (classid == 3)
	{
		gTeam[playerid] = TEAM_HOMELAND_SECURITY;
	}
	else if (classid == 4)
	{
		gTeam[playerid] = TEAM_DESERT_EAGLES;
	}
	else if (classid == 5)
	{
		gTeam[playerid] = TEAM_CIVILIAN;
	}
	else if (classid == 6)
	{
		gTeam[playerid] = TEAM_CRIMINAL;
	}
}
//----------------------------------------------------------------------------//
SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_POLICE)
	{
		SetPlayerColor(playerid,0x33CCFFAA);//Light Blue
	}
	else if (gTeam[playerid] == TEAM_EMERGENCY)
	{
		SetPlayerColor(playerid,0x33FF33AA);//Green
	}
	else if (gTeam[playerid] == TEAM_ADMINS)
	{
		SetPlayerColor(playerid,0xFFFFFFAA);//White
	}
	else if (gTeam[playerid] == TEAM_HOMELAND_SECURITY)
	{
		SetPlayerColor(playerid,0x33CCFFAA);
	}
	else if (gTeam[playerid] == TEAM_DESERT_EAGLES)
	{
		SetPlayerColor(playerid,0x33FF33AA);//Green2
	}
	else if (gTeam[playerid] == TEAM_CIVILIAN)
	{
		SetPlayerColor(playerid,0xFFFF00AA);//Yellow
	}
    else if (gTeam[playerid] == TEAM_CRIMINAL)
	{
		SetPlayerColor(playerid,0xFF0000AA);//Red
	}
}
if there is problem plz tell me Is this team right
Reply
#2

Do you actually call the function at any point?

Also, you do not need to use else if, as they can only meet one condition of the same variable.
Reply
#3

What should I do to make teams and give them colours? plz write code please
Reply
#4

pawn Код:
if(GetPlayerTeam(playerid) == 1)
{
     SetPlayerColor(playerid, COLOUR) //Team 1
}
Repeat for the amount of teams you have...
Reply
#5

pawn Код:
OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColor(playerid);
}
But it really depends how you want it to work.
Reply
#6

Thanks guy it worked Thanks yeahhhhh
Reply
#7

Anytime
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)