SA-MP Forums Archive
problem with coloring the chat - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem with coloring the chat (/showthread.php?tid=245294)



problem with coloring the chat - HeLiOn_PrImE - 30.03.2011

We are trying to put a default chat color different than white but we came across a problem that we can't solve. Every time a player writes 2 rows, the color of the second row remains white. Can some one help me, please


Re: problem with coloring the chat - austin070 - 30.03.2011

We need your code.


Re: problem with coloring the chat - grand.Theft.Otto - 30.03.2011

If you're using something similar to this...

pawn Code:
new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(text, 1024, "%s (%d): {FFFFFF}%s", PlayerName, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), text);
...Then try replacing the {FFFFFF} with your own colour.


Re: problem with coloring the chat - Lynn - 30.03.2011

I'd suggest not allowing two rows of text.
Simple fix to this problem.


Re: problem with coloring the chat - HeLiOn_PrImE - 31.03.2011

I'll Discuss this with my mate, see if we use something similar.


Re: problem with coloring the chat - HeLiOn_PrImE - 04.04.2011

we use something like this:

Code:
new MMM[256];
format(MMM, sizeof(MMM),"(ID:%i): %s", playerid, text);
SendPlayerMessageToAll(playerid, MMM);
We need to make a new line if there are more than 55 characters. something like "/n", i don't know...


Re: problem with coloring the chat - HeLiOn_PrImE - 06.04.2011

This will allow the second row to be colored?


Re: problem with coloring the chat - [DJ]Boki - 06.04.2011

Code:
public OnPlayerText(playerid, text[])
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(text,128,"(%d)%s: %s",playerid, name, text);
    SendClientMessageToAll(GetPlayerColor(playerid),text);
    return 0;
}
this should help