SA-MP Forums Archive
Hex Colour[+Help] - 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: Hex Colour[+Help] (/showthread.php?tid=470082)



Hex Colour[+Help] - tvt - 16.10.2013

when add scrip, Only show 6 zero the end of the hex

SendClientMessageEx(playerid, 9276927, string);

Can i help me ?


Re: Hex Colour[+Help] - Isolated - 16.10.2013

Not sure what your problem is, however it should be like #9276927FF


Re: Hex Colour[+Help] - tvt - 16.10.2013

How ?


Re: Hex Colour[+Help] - newbie scripter - 16.10.2013

goto ****** , search the color name with hex code eg : Black color hex code, etc


Re: Hex Colour[+Help] - tvt - 16.10.2013

I use Hex downloaded from the database

i need for example


Re: Hex Colour[+Help] - Isolated - 16.10.2013

pawn Код:
#define COLOR_BLACK #00000000 // 6 digits, followed by 2 transparency specifiers.

SendClientMessage(playerid, COLOR_BLACK, "This is a color..");
Quote:
Originally Posted by wiki.sa-mp.com
RR - Two values for the red (Where FF is max, and 00 is the lowest).
GG - Two values for the green (Where FF is max, and 00 is the lowest).
BB - Two values for the blue (Where FF is max, and 00 is the lowest).
AA - Two values for the transparency (Where FF is max, and 00 is the lowest).
Hope this helps.


Re: Hex Colour[+Help] - tvt - 16.10.2013

Me use the colors of this for one looks formula colors of Đаi delivery thanh and it is tаi tử databases after transferred guide words (me going: 0x8D8DFFFF it will be saved on databases: 9276927), but on me use the direct word 9276927 in colors, Only show 6 zero the end of the hex
sorry, Bad english


Re: Hex Colour[+Help] - Konstantinos - 16.10.2013

Quote:
Originally Posted by Isolated
Посмотреть сообщение
pawn Код:
#define COLOR_BLACK #00000000 // 6 digits, followed by 2 transparency specifiers.

SendClientMessage(playerid, COLOR_BLACK, "This is a color..");


Hope this helps.
Excuse me, but have you even tried your code? The second parameter is INTEGER, not a string.

tvt, would you mind to explain what you want? Let's say you want to show a message with red color (defining it makes it easier for the most users).

pawn Код:
#define COLOR_RED 0xFF0000FF
pawn Код:
SendClientMessage(playerid, COLOR_RED, "This is a color..");
You can convert colours by using any online converter (I use: http://www.javascripter.net/faq/rgbtohex.htm)

Change the values of R G B (0-255) and at the right side, it will give the 6 digits for the color. You can add 0x before and FF after and you're done.

For example, FFFF00 is (255 255 0, which is yellow). Doing 0xFFFF00FF is yellow.

EDIT: You edited your post. Okay, like I said hex ARE numbers. Even if you use that number instead, it will still be the color you wanted to.


Re: Hex Colour[+Help] - tvt - 16.10.2013

when I use the format

Код:
new color = 9276927;
Here is the hex to RPG when I type in a dialog it is stored on the database as integers
hex triplet #8d8dff has decimal index of: 9276927

Код:
{%6x}
for example

Код:
format(szDialogStr, sizeof szDialogStr, "{%6x}this is a color", color);
it works

I use it to send the RADIO that does not work switch to a different color than the part I bolded 9276927
Код:
format(szDialogStr, sizeof szDialogStr, "this is a color",);
Код:
SendClientMessageEx(playerid, color, szDialogStr);
it does not work


Re: Hex Colour[+Help] - Akcent_Voltaj - 16.10.2013

i dont define colors i use them like this:

SendClientMessageEx(playerid, 0x927692FF, string);

only 6 digit works!


in front of 927692 i put 0x and at last i put FF like this 0x927692FF

test it.