#1

Hi, I have problem, how use many colors name in function SendClientMessage ?

for example:
PHP код:
SCM(playerid, -1""RED"[Connecting]: "WHITE"Player "RED"%s"WHITE"["ORANGE"%d"WHITE"] incoming"GetPlayerNick(playerid), playerid); 
<- How I can make this?
Reply
#2

You're better off using Hex codes.

PHP код:
SCM(playerid, -1"{FF0000}[Connecting]: {FFFFFF}"Player {FF0000}%s{FFFFFF}[{FF5733}%d{FFFFFF}] incoming", GetPlayerNick(playerid), playerid); 
Use this site: https://htmlcolorcodes.com/

E: These are the codes you should be looking for:
Reply
#3

Код:
#define COL_WHITE "{FFFFFF}"
#define COL_GREEN "{00FF00}"
#define COL_YELLOW "{FFDD00}"

#define SCM SendClientMessage //I don't suggest u to do that.

SendClientMessage(playerid, -1, COL_WHITE"text it's white "COL_YELLOW"text it's yellow"COL_GREEN"text it's red");
Reply
#4

PHP код:
 SCM(playerid, -1"{FF0000}[Connecting]: {FFFFFF}Player {FF0000}%s{FFFFFF}[{FF5733}%d{FFFFFF}] incoming"GetPlayerNick(playerid), playerid); 
Reply
#5

Quote:
Originally Posted by DeMoo
Посмотреть сообщение
PHP код:
 SCM(playerid, -1"{FF0000}[Connecting]: {FFFFFF}Player {FF0000}%s{FFFFFF}[{FF5733}%d{FFFFFF}] incoming"GetPlayerNick(playerid), playerid); 
This it's so worng. You can't do this on SendClientMessage, you need to prepare a string...

Like so.
Код:
new string[100];

format(string, sizeof(string), "{FF0000}[Connecting]: {FFFFFF}Player {FF0000}%s{FFFFFF}[{FF5733}%d{FFFFFF}] incoming", GetPlayerNick(playerid), playerid);

SendClientMessage(playerid, -1, string);
Reply
#6

^^ This guy has the skills.
Reply
#7

Quote:
Originally Posted by kingmk
Посмотреть сообщение
This it's so worng. You can't do this on SendClientMessage, you need to prepare a string...

Like so.
Код:
new string[100];

format(string, sizeof(string), "{FF0000}[Connecting]: {FFFFFF}Player {FF0000}%s{FFFFFF}[{FF5733}%d{FFFFFF}] incoming", GetPlayerNick(playerid), playerid);

SendClientMessage(playerid, -1, string);
Sorry I forgot
Reply
#8

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
^^ This guy has the skills.
He never said he had an issue, he was asking about the color. Plus, he said "for example" meaning he could of just wrote that right off the bat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)