Hex to color string - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hex to color string (
/showthread.php?tid=220443)
Hex to color string -
ikkentim - 03.02.2011
is there any way to do this?
something like
Code:
#define COLOR_RED 0xFF0000FF
new string[10];
new aString[100];
..(don't know how to do this)..
format(aString, 100, "{%s} This is red and {FFFFFF}this is white", string);
//aString has to be now {FF0000} This is red and {FFFFFF}this is white
// making the text red and white
Any way to do this? thanks
Re: Hex to color string -
Bumbis - 03.02.2011
Yes it works
pawn Code:
#define COLOR_RED FF0000
#define COLOR_GREEN 00FF00
new string[60];
format(string,50,"{%s} Red {%s} Green",COLOR_RED,COLOR_GREEN);
It will not work with your color e.g. 0xFF0000FF.
You dont need that 0x and alpha(The FF in end) in text and dialog colors.
Re: Hex to color string -
Zh3r0 - 03.02.2011
Isn't this easier?
https://sampforum.blast.hk/showthread.php?tid=196360