(Strings) How to color sections of the string
#1

So, I have a command which issues a server restart, It says "% has issued a server restart" however I would like "Server Restart" to be a different color, and the color of the string is Lightred, so How can I do so?
Reply
#2

Colors


pawn Код:
//Example:
SendClientMessage( playerid, -1, "{00FF00}Server {0000FF}Restart");

//0000FF is red
//00FF00 is lime
Reply
#3

Yes, but I'm using a string, which afterwards runs SendClientMessageToAll, so How do I pinpoint where I would like the different color?

Код:
format(string, sizeof(string), "AdmCmd: %s has issued a Server Restart, it will occur in 30 seconds. Be sure to /park your vehicle(s)!", RPN(playerid));
	SendClientMessageToAll(COLOR_LIGHTRED, string);
Reply
#4

pawn Код:
format(string, sizeof(string), "AdmCmd: %s {FFFFFF}has {FF0000}issued a Server Restart, {00FF00}it will occur in 30 seconds. Be sure to /park your vehicle(s)!", RPN(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Just use it, like when you're using SendClientMessage.
Note: If you want to use a GameTextForPlayer you must use:
~g~, ~r~ ...etc
Reply
#5

You just insert the color code at where you want.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)