SetPlayerColor - 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: SetPlayerColor (
/showthread.php?tid=560496)
SetPlayerColor -
Derexi - 28.01.2015
I'm loading colours as decimal numbers from my database and into player variables. When they connect, if their colour hasn't been set (== 0), it chooses a random colour and sets it with setplayercolor, but if their colour has been set it uses SetPlayerColor(playerid, pData[playerid][Color]). But, in-game, the chat messages show the correct colours (colours from variables), but on the player list (TAB) and on the map icons, it shows different colours.
I added two debug messages. One prints the player's colour variable after it's loaded, and the other prints the player's colour from GetPlayerColor. They both return the same value.
Re: SetPlayerColor -
Raisingz - 28.01.2015
That seems odd. Have you tried creating a command that sets a player to a certain color?
Re: SetPlayerColor -
Derexi - 28.01.2015
Quote:
Originally Posted by ******
Have you set the alpha channel as well as RGB?
|
Absolutely. I couldn't figure it out for the life of me, so instead, I'm assigning new players an RGB -> decimal converted number comprised of 3 random numbers between 60 and 255, and the alpha will be set at 255 for everyone. It just works using this method. No idea what was wrong

All sorted now though.