PDA

View Full Version : [HELP] Multiple colors 1 line?


MadalinX5
13/11/2011, 01:57 PM
Hello :)
I'm trying to create a message:

SendClientMessage(playerid, COLOR_GREEN, "System: Online");


But I want to give the color Yellow to "System:" and green to "Online" like 2 colors in 1 line. How can I do this?

Thank you,
MadalinX5

Kostas'
13/11/2011, 02:01 PM
//At The Top
#define COLOR_YELLOW 0xFFFF00FF

Your message

SendClientMessage(playerid, COLOR_YELLOW, "System: {00FF00}Online");


Note: Green is 0x00FF00FF. Just use {} and the RGB In it {00FF00}

MadalinX5
13/11/2011, 02:11 PM
//At The Top
#define COLOR_YELLOW 0xFFFF00FF

Your message

SendClientMessage(playerid, COLOR_YELLOW, "System: {00FF00}Online");


Note: Green is 0x00FF00FF. Just use {} and the RGB In it {00FF00}

Can't I use my defines?


SendClientMessage(playerid, COLOR_YELLOW, "System: {COLOR_GREEN}Online");

Kostas'
13/11/2011, 02:19 PM
You can use the RGB code from your defines.
For example this is orange

#define COLOR_ORANGE 0xFF9600FF

You need to take the RGB from it.

0xFF9600FF

R = FF
G = 96
B = 00
And you can use it inside the {}
Like {FF9600}

Babul
13/11/2011, 02:28 PM
#define green 00ff00

//filterscriptinit
new test[128];
format(test,sizeof(test),"123 {"#green"}456");
SendClientMessageToAll(0xffffffff,test);

just whipped that together, and.. it works :)

Killa[DGZ]
13/11/2011, 02:35 PM
Can't I use my defines?


SendClientMessage(playerid, COLOR_YELLOW, "System: {COLOR_GREEN}Online");


no, i think you would need to double up on your defines in order for that to work.



#define COLOR_GREEN 0x00FF00AA

#define TEXT_GREEN 00FF00


no mb!, use Babul's example

CSSI
13/11/2011, 02:39 PM
#define TEXT_GREEN "{00FF00}"

SendClientMessage(playerid, COLOR_YELLOW, "System: "TEXT_GREEN"Online");