[HELP] Multiple colors 1 line?
#1

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
Reply
#2

pawn Код:
//At The Top
#define COLOR_YELLOW 0xFFFF00FF
Your message
pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, "System: {00FF00}Online");
Note: Green is 0x00FF00FF. Just use {} and the RGB In it {00FF00}
Reply
#3

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
//At The Top
#define COLOR_YELLOW 0xFFFF00FF
Your message
pawn Код:
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?

pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, "System: {COLOR_GREEN}Online");
Reply
#4

You can use the RGB code from your defines.
For example this is orange
pawn Код:
#define COLOR_ORANGE 0xFF9600FF
You need to take the RGB from it.
pawn Код:
0xFF9600FF
R = FF
G = 96
B = 00
And you can use it inside the {}
Like {FF9600}
Reply
#5

Код:
#define green 00ff00

//filterscriptinit
new test[128];
format(test,sizeof(test),"123 {"#green"}456");
SendClientMessageToAll(0xffffffff,test);
just whipped that together, and.. it works
Reply
#6

Quote:
Originally Posted by MadalinX5
Посмотреть сообщение
Can't I use my defines?

pawn Код:
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.
pawn Код:
#define COLOR_GREEN 0x00FF00AA

#define TEXT_GREEN 00FF00
no mb!, use Babul's example
Reply
#7

pawn Код:
#define TEXT_GREEN "{00FF00}"

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


Forum Jump:


Users browsing this thread: 1 Guest(s)