SA-MP Forums Archive
Set player color ain't working - 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: Set player color ain't working (/showthread.php?tid=561821)



Set player color ain't working - Kruno88 - 05.02.2015

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


Re : Set player color ain't working - Alvin007 - 05.02.2015

Do you have local chat? Show me OnPlayerText


Re: Set player color ain't working - Kruno88 - 05.02.2015

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

Quote:

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




Re: Set player color ain't working - Stanford - 05.02.2015

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!


Re: Set player color ain't working - Kruno88 - 05.02.2015

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



Re: Set player color ain't working - Ciarannn - 05.02.2015

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)



Re: Set player color ain't working - Kruno88 - 05.02.2015

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);



Re: Set player color ain't working - HY - 05.02.2015

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



Re: Set player color ain't working - NGGMars - 05.02.2015

There is a player color plugin...

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