TEAMS: Any team I choose sets me to the same color.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TEAMS: Any team I choose sets me to the same color.. (
/showthread.php?tid=508034)
TEAMS: Any team I choose sets me to the same color.. -
NoahF - 20.04.2014
Hello!
ANY team that I select on my server, makes my name the color Orange. I have no idea why as I have defined different colors for each team. Check out the code:
Код:
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == UndeadEnemies)
{
SetPlayerColor(playerid,UndeadEnemiesGangColor);
}
else if(gTeam[playerid] == Cripz)
{
SetPlayerColor(playerid,CripzGangColor);
}
if(gTeam[playerid] == BloodBrothers)
{
SetPlayerColor(playerid,BloodBrothersGangColor);
}
if(gTeam[playerid] == Maniacs)
{
SetPlayerColor(playerid,ManiacsGangColor);
}
}
SetPlayerToTeamColour(playerid); // calls the custom function
---------------------------------------------------------------------------------------------------------------
#define UndeadEnemies 0
#define Cripz 1
#define BloodBrothers 2
#define Maniacs 3
#define UndeadEnemiesGangColor 0xFFFF0000
#define CripzGangColor 0xFF0000FF
#define BloodBrothersGangColor 0x008000C8
#define ManiacsGangColor 0xFFFF8040
---------------------------------------------------------------------------------------------------------------
public SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0) //CHANGE GAMETEXTFORPLAYER TO SENDCLIENTMESSAGE -- finished
{
SendClientMessage(playerid, 0xFFFF0000, "Undead Enemies"); // This will show up an Text , when you select your class
}
else if(classid == 1) //CHANGE GAMETEXTFORPLAYER TO SENDCLIENTMESSAGE -- finished
{
SendClientMessage(playerid, 0xFF0000FF, "Cripz");
}
else if(classid == 2) //CHANGE GAMETEXTFORPLAYER TO SENDCLIENTMESSAGE -- finished
{
SendClientMessage(playerid, 0xFF00FF00, "Blood Brothers");
}
else if(classid == 3) //CHANGE GAMETEXTFORPLAYER TO SENDCLIENTMESSAGE -- finished
{
SendClientMessage(playerid, 0xFFFF8040, "Maniacs");
}
return 1;
}
I don't get any errors or warnings when compiling. Any help is appreciated!
Re: TEAMS: Any team I choose sets me to the same color.. -
luis_mendoza - 20.04.2014
Well have you anywhere set that gTeam when he chooses a team ?
Re: TEAMS: Any team I choose sets me to the same color.. -
NoahF - 20.04.2014
Yes, but I took it out trying to fix the problem.
Re: TEAMS: Any team I choose sets me to the same color.. -
luis_mendoza - 20.04.2014
You took it out , but as I see , there it checks the team.
pawn Код:
if(gTeam[playerid] == UndeadEnemies)
{
Re: TEAMS: Any team I choose sets me to the same color.. -
NoahF - 20.04.2014
Yes. ^
Re: TEAMS: Any team I choose sets me to the same color.. -
NoahF - 20.04.2014
Bump
Re: TEAMS: Any team I choose sets me to the same color.. -
DerickClark - 20.04.2014
Add OnPlayerSpawn,
SetPlayerToTeamColour(playerid);
Re: TEAMS: Any team I choose sets me to the same color.. -
NoahF - 20.04.2014
Quote:
Originally Posted by DerickClark
Add OnPlayerSpawn,
SetPlayerToTeamColour(playerid);
|
I have that. :P
Re: TEAMS: Any team I choose sets me to the same color.. -
DerickClark - 20.04.2014
Remove the color
and post up top gamemode
pawn Код:
#define UndeadEnemies 0
#define Cripz 1
#define BloodBrothers 2
#define Maniacs 3
#define UndeadEnemiesGangColor 0xFFFF0000
#define CripzGangColor 0xFF0000FF
#define BloodBrothersGangColor 0x008000C8
#define ManiacsGangColor 0xFFFF8040
Re: TEAMS: Any team I choose sets me to the same color.. -
NoahF - 20.04.2014
Done, nothing.