Set player color ain't working
#1

So I use
Код:
        SetPlayerColor(playerid, COLOR_RED);
Код:
#define COLOR_RED 0xAA3333AA
But it ain't working when talking in chat.Lol.How can you help me? :P
Reply
#2

Do you have local chat? Show me OnPlayerText
Reply
#3

Umm...I have no idea what you're talking about lol

Quote:

public OnPlayerText(playerid, text[])
{
return 1;
}

Reply
#4

So you want his name to appear in the chat as his color?, here's an example:
pawn Код:
public OnPlayerText(playerid, text[])
{
      if(AccountInfo[playerid][pColor] == 2) // or any number that represents red (u set these things)
      {
            new string[128], playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername);
            format(string,sizeof(string), "%s:"#COL_WHITE" %s", playername,text);
      }
      SendClientMessageToAll(COLOR_WHITE, string);
      return 1;
}
Set the defintions of the colors.
hint: #COL_WHITE is a 0.3c color.
I hope I helped any feedback would be appreciated!
Reply
#5

Quote:
Originally Posted by Stanford
Посмотреть сообщение
So you want his name to appear in the chat as his color?, here's an example:
pawn Код:
public OnPlayerText(playerid, text[])
{
      if(AccountInfo[playerid][pColor] == 2) // or any number that represents red (u set these things)
      {
            new string[128], playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername);
            format(string,sizeof(string), "%s:"#COL_WHITE" %s", playername,text);
      }
      SendClientMessageToAll(COLOR_WHITE, string);
      return 1;
}
Set the defintions of the colors.
hint: #COL_WHITE is a 0.3c color.
I hope I helped any feedback would be appreciated!
Errors,can you please set it up and I'll +REP you
For all teams:

Код:
#define TEAM_GROVE 1
#define  TEAM_BALLAS 2
#define  TEAM_VAGOS 3
#define TEAM_BARBERS 4
Код:
COLOR_GREEN
COLOR_RED
COLOR_YELLOW
COLOR_BLUE
Reply
#6

Quote:
Originally Posted by Kruno88
Посмотреть сообщение
Errors,can you please set it up and I'll +REP you
For all teams:

Код:
#define TEAM_GROVE 1
#define  TEAM_BALLAS 2
#define  TEAM_VAGOS 3
#define TEAM_BARBERS 4
Код:
COLOR_GREEN
COLOR_RED
COLOR_YELLOW
COLOR_BLUE
Show your code to check what team the player is on, I will do it.

Like:

pawn Код:
if(PlayerInfo[playerid][Grove] = 1)
Reply
#7

Quote:
Originally Posted by Stanford
Посмотреть сообщение
So you want his name to appear in the chat as his color?, here's an example:
pawn Код:
public OnPlayerText(playerid, text[])
{
      if(AccountInfo[playerid][pColor] == 2) // or any number that represents red (u set these things)
      {
            new string[128], playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername);
            format(string,sizeof(string), "%s:"#COL_WHITE" %s", playername,text);
      }
      SendClientMessageToAll(COLOR_WHITE, string);
      return 1;
}
Set the defintions of the colors.
hint: #COL_WHITE is a 0.3c color.
I hope I helped any feedback would be appreciated!
eRROR
Код:
warning 202: number of arguments does not match definition
Код:
            GetPlayerName(playerid, playername);
Reply
#8

pawn Код:
GetPlayerName(playerid, playername, sizeof(playername));
Reply
#9

There is a player color plugin...

It will be more usefull for you... Try it.
Also better for adding to your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)