Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Pun1sh3r on Aug 11, 2015, 05:10 PM

Title: Convert RGB Player Colors to HEX Code for Textdraws?
Post by: Pun1sh3r on Aug 11, 2015, 05:10 PM
Hello all,

I want to Improve my Deathlist and make it colored and I want to convert the Player Color to HEX Code for Textdraws.
How exactly I can do this? I was trying to make it possible but failed cause one time the server said "Expected int and got string"


Would be nice if anyone of you can help me out with this Problem, thanks!
Title: Re: Convert RGB Player Colors to HEX Code for Textdraws?
Post by: DizzasTeR on Aug 11, 2015, 05:20 PM
www.Colourpicker.com (http://www.colourpicker.com)
Title: Re: Convert RGB Player Colors to HEX Code for Textdraws?
Post by: Pun1sh3r on Aug 11, 2015, 05:34 PM
Quote from: Doom_Killer on Aug 11, 2015, 05:20 PMwww.Colourpicker.com (http://www.colourpicker.com)

Well, that was not the answer I expected.
Title: Re: Convert RGB Player Colors to HEX Code for Textdraws?
Post by: DizzasTeR on Aug 11, 2015, 05:50 PM
If you are talking about using different colours in textdraw, its not possible, if you want to colour then you can convert your RGB to Hex you can use that site.
Title: Re: Convert RGB Player Colors to HEX Code for Textdraws?
Post by: Thijn on Aug 11, 2015, 06:10 PM
You probably mean something like:
local color = RGB( 255, 0, 0); //Red.
local drawColor =  color.r << 24 | color.g << 16 | color.b << 8 | 255 );

Where that last 255 is the alpha.
Title: Re: Convert RGB Player Colors to HEX Code for Textdraws?
Post by: Pun1sh3r on Aug 11, 2015, 07:09 PM
Quote from: Thijn on Aug 11, 2015, 06:10 PMYou probably mean something like:
local color = RGB( 255, 0, 0); //Red.
local drawColor =  color.r << 24 | color.g << 16 | color.b << 8 | 255 );

Where that last 255 is the alpha.

Exactly, thanks!