SA-MP Forums Archive
[Error]Colour in join/leave messages -HELP ME = rep+ xD - 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: [Error]Colour in join/leave messages -HELP ME = rep+ xD (/showthread.php?tid=442874)



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

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}


Re: [Error]Colour in join/leave messages -HELP ME = rep+ xD - InTeL_cOrE_i7 - 09.06.2013

Help me


Re: [Error]Colour in join/leave messages -HELP ME = rep+ xD - Basssiiie - 09.06.2013

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.


Re: [Error]Colour in join/leave messages -HELP ME = rep+ xD - Facerafter - 09.06.2013

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



Re: [Error]Colour in join/leave messages -HELP ME = rep+ xD - InTeL_cOrE_i7 - 09.06.2013

wow thx guys, it worked, rep+ for you...


Re: [Error]Colour in join/leave messages -HELP ME = rep+ xD - Guest123 - 09.06.2013

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