SA-MP Forums Archive
No colors. - 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: No colors. (/showthread.php?tid=554319)



No colors. - Glossy42O - 03.01.2015

Hello that's my code.


PHP код:
public OnPlayerSpawn(playerid)
{
  switch(
GetPlayerTeam(playerid))
  {
    case 
29 .. 100:
    {
      
SetPlayerColor(playeridCOLOR_RED);
      
SetPlayerTeam(playeridTEAM_TERROR);
    }
    case 
285 .. 287:
    {
      
SetPlayerColor(playeridCOLOR_BLUE);
      
SetPlayerTeam(playeridTEAM_ARMY);
    }
  }
  return 
1;

The problem is it doesn't make the colors.. to the player


Re: No colors. - ATGOggy - 03.01.2015

Are you sure that you can use '..'?


Re: No colors. - Glossy42O - 03.01.2015

Yeah.

It suppose to be like that


Re: No colors. - ATGOggy - 03.01.2015

Where do you assign them a team?
in AddPlayerClassEx?


Re: No colors. - Glossy42O - 03.01.2015

What do you mean? where i have AddPlayerClas(....) ?

if yes on gamemodeinit..


Re: No colors. - ATGOggy - 03.01.2015

I mean, do you have AddPlayerClass or AddPlayerClassEx?
If you have AddPlayerClass, did you use SetPlayerTeam somewhere other than here?


Re: No colors. - Glossy42O - 03.01.2015

Addplayerclass.

And the only place i used set team is the.. ^^code above


Re: No colors. - ATGOggy - 03.01.2015

How can you use GetPlayerTeam if you didn't assign them a team?

You need to assign each class a team, then you need to use GetPlayerTeam and SetPlayerColor.

I suggest you to change all AddPlayerClass to AddPlayerClassEx and add a team there.


Re: No colors. - Glossy42O - 03.01.2015

I did everything correctly.

At the top.

#define TEAM_TERROR

#define TEAM_ARMY


Then ofc i got the colors also defined.


Re: No colors. - ATGOggy - 03.01.2015

You defined teams but you didn't assign the teams to classes.

If you need to use GetPlayerTeam, you need to use SetPlayerTeam first.