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



PlayerTextColor - Arxalan - 03.01.2015

Hello , i want to know how to change the player text message color?


Re: PlayerTextColor - biker122 - 03.01.2015

Explain more. I don't understand a shit..
What text message, where do you send that message? Show a part of its code.


Re: PlayerTextColor - Kelbac - 03.01.2015

i think do you mean the text on the chat... Show me your enum and i will do it.


Re: PlayerTextColor - ATGOggy - 03.01.2015

https://sampwiki.blast.hk/wiki/Colors_List
This may help you.


Re: PlayerTextColor - Arxalan - 03.01.2015

For Example , player type "hello" so his text will be show to players in white color but i want to make different. When player type /red so his text message appear is red such that if he type "hello" players will see his message in red color.


Re: PlayerTextColor - ATGOggy - 03.01.2015

This is from my script, I think you are looking for this,
PHP код:
public OnPlayerText(playeridtext)
{
    new 
playername[128], message[128];
    
GetPlayerName(playeridplayernamesizeof(playername));
    
format(messagesizeof(message), "{%06x}%s[%d]:{FFFFFF} %s"GetPlayerColor(playerid) >>> 8playernameplayeridtext);
    
SendClientMessageToAll(COLOR_WHITEmessage);
    return 
1;




Re: PlayerTextColor - Arxalan - 03.01.2015

i am getting error in that code about mismatch of argument.
I got the solution from wiki . but i have another problem

PHP код:
#define COLOR_RED_EMBED "FF0000"
 
SendClientMessage(playerid, -1"This is white and {"COLOR_RED_EMBED"}this is red."); 
if i add the above code in OnPlayerText then it will send the message to that player in white and red color . but i want that if the player type /red then only in that case the half message appears red and if he again type /red so the code reset to default (all text appear in white)


Re: PlayerTextColor - Kelbac - 03.01.2015

ow i think that is Impossible

i think you want this:

Player: Hello

and then when he type /red it should be like this:

Player: Hello

Yes i think that is impossible :3


Re: PlayerTextColor - ATGOggy - 03.01.2015

Quote:
Originally Posted by Kelbac
Посмотреть сообщение
ow i think that is Impossible

i think you want this:

Player: Hello

and then when he type /red it should be like this:

Player: Hello

Yes i think that is impossible :3
Yeah, it's impossible.


Re: PlayerTextColor - biker122 - 03.01.2015

If you need something like Kelbac said, just tell us. It's possible to do something like;
If you type /red, It will be like Player: Text
You can change the text colours to any color according to the players' choice, but cannot split up the colors in the middle of the sentence (pre-scripted wise). You could check this latest filterscript and use it if you wish:
https://sampforum.blast.hk/showthread.php?tid=553655