Multicolored formatted strings?
#1

Код:
	format(string, sizeof(string), "{00FF00}Successfully logged in! {FFFFFF}Welcome back to LS{FF0000}GL{FFFFFF} %s. We hope you enjoy your stay!{FFFF00} (Last Login: %s ago)", name, ReturnTimelapse(eUser[playerid][e_USER_LASTLOGIN_TIMESTAMP], gettime()));
	SendClientMessage(playerid, -1, string);
This doesn't show up when a player logs in. But When I do this -

Код:
	format(string, sizeof(string), "Successfully logged in! Welcome back to LSGL %s. We hope you enjoy your stay!(Last Login: %s ago)", name, ReturnTimelapse(eUser[playerid][e_USER_LASTLOGIN_TIMESTAMP], gettime()));
	SendClientMessage(playerid, -1, string);
It works.

Why doesn't it shows up as a multi-colored string?
Reply
#2

https://sampwiki.blast.hk/wiki/SendClientMessage

Quote:

If a message is longer than 144 characters, it will not be sent. Truncation can be used to prevent this. Displaying a message on multiple lines will also solve this issue.

So you can display the last login information in a next line.

As for the first embedded color, instead of:
Код:
format(string, sizeof(string), "{00FF00}Successfully ...
SendClientMessage(playerid, -1, string);
you can just use:
Код:
format(string, sizeof(string), "Successfully ...
SendClientMessage(playerid, 0x00FF00FF, string);
Reply
#3

10/10. Thankyou
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)