No colors.
#1

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
Reply
#2

Are you sure that you can use '..'?
Reply
#3

Yeah.

It suppose to be like that
Reply
#4

Where do you assign them a team?
in AddPlayerClassEx?
Reply
#5

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

if yes on gamemodeinit..
Reply
#6

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

Addplayerclass.

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

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.
Reply
#9

I did everything correctly.

At the top.

#define TEAM_TERROR

#define TEAM_ARMY


Then ofc i got the colors also defined.
Reply
#10

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)