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



Chat color - Gooday - 09.03.2012

pawn Код:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname, '_', ' ');
                                                  //This will show when player speaks FirstName_LastName says: test
    format(str, sizeof(str), "{0xAFAFAFAA}%s{0xAFAFAFAA}: %s", pname, text);
    ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 0;
}
I added the codes for the color but the chat still be white and i see the numbers, i would have the NAME clored and the text white


Re: Chat color - CmZxC - 09.03.2012

remove the 0x from the color codes


Re: Chat color - Reklez - 09.03.2012

pawn Код:
#define COLOR_1 "{0xAFAFAFAA}"
#define COLOR_2 "{0xAFAFAFAA}"

format(str, sizeof(str), ""COLOR_1"%s"COLOR_2": %s", pname, text);
this is more neater

Do what the person says above