[Error]Colour in join/leave messages -HELP ME = rep+ xD
#1

Code i used:
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{CCCCCC}>>JOIN: {99FF33}%s {CCCCCC}has Joined the server", pname);
SendClientMessageToAll(-1, string);

What is wrong:
it send the message, but it looks like this,
and it must look like this, i used SendClientMessage(playerid, -1, "{CCCCCC}>>JOIN: {99FF33}[UF]ic3_cr3am {CCCCCC}has Joined the server"); Just to show u what it must look like

The Players name must be in green, colour code, {99FF33} and the other part of the message, in grey, colour code, {CCCCCC}
Reply
#2

Help me
Reply
#3

You have "string[22 + MAX_PLAYER_NAME]".
That's way too few characters to support that whole string. That's why it's cut off, there's no more space in the string.
Reply
#4

Try increasing the size of the string.
pawn Code:
new pname[MAX_PLAYER_NAME], string[128 + MAX_PLAYER_NAME];
Reply
#5

wow thx guys, it worked, rep+ for you...
Reply
#6

pawn Code:
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "{CCCCCC}>>JOIN: {99FF33}%s {CCCCCC}has Joined the server", str);
SendClientMessageToAll(-1, str);
EDIT: they faster than me LOLOL
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)