SA-MP Forums Archive
SCM ? - 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: SCM ? (/showthread.php?tid=650235)



SCM ? - Oficer - 23.02.2018

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?


Re: SCM ? - aoky - 23.02.2018

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:


Re: SCM ? - kingmk - 23.02.2018

Код:
#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");



Re: SCM ? - DeMoo - 24.02.2018

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



Re: SCM ? - kingmk - 24.02.2018

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);



Re: SCM ? - Sew_Sumi - 24.02.2018

^^ This guy has the skills.


Re: SCM ? - DeMoo - 24.02.2018

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


Re: SCM ? - aoky - 24.02.2018

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.