Chat name color.
#1

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

Nitrex show with color lime?


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

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
Reply
#3

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); 
Reply
#4

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.
Reply
#5

Thank you + rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)