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



Chat name color. - Sn4ke2 - 28.06.2015

How to make when "Nitrex say:..."

Nitrex show with color lime?


загрузить картинку на сайт


Re: Chat name color. - Kwarde - 28.06.2015

In OnPlayerText, format your own chat messages and simply add a color code (either using the RGBA in the client message, or the ~{RGB}~ in the client message. Make sure you return 0 (zero) to prevent the default text from being sent.

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


Re: Chat name color. - Sn4ke2 - 28.06.2015

I find, i make but now i want to say "NiTr3X [ID:%d] say:" but i don't know how to make...
PHP код:
GetPlayerName(playeridsendernamesizeof(sendername));
        
format(stringsizeof(string), "{1AD6C4}%s spune:{FFFFFF} %s"sendernametext);
        if(
PlayerInfo[playerid][pAdmin] >= 1SetPlayerChatBubble(playeridstring0xFFFF66FF20.010000);
        if(
PlayerInfo[playerid][pHelper] >= 1SetPlayerChatBubble(playeridstring0xa9c4e4FF20.010000);
         
ProxDetector(20.0playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); 



Re: Chat name color. - Kwarde - 28.06.2015

Ah you want to add the player ID?
Simply add the '[ID: %d]' after the first '%s', and after the sendername (inside the format command), add 'playerid'. Quite easy..

Also, I'm not sure if you want especially for you a different color, but it won't work this way. The colours defined in SetPlayerChatBubble/ProxDetector (which eventually is just a SendClientMessage(*)) are overrided by the color codes in the format/text[] string. What you then could do, is add an extra if statement which checks if the 'sendername' is "NiTr3X" (using strcmp) and then create a total new format with different colours.


Re: Chat name color. - Sn4ke2 - 28.06.2015

Thank you + rep