PDA

View Full Version : TF2 Colourful chat messages


_cyruss_
02-05-2008, 14:36
Hey guys,

How can you have different colours in your chat message like this, see screenshot attached

I know you can have red players have red output, and blue team blue messages, and spectators grey, but this was all at once to the whole server (not a specific player),

how can this be achieved?

Nican
02-05-2008, 15:56
For exemple (My bank plugin):


PrintToChatAll("[NC] \x04[SM Bank]\x01 Admin has changed your money");

Output:

[SM Bank] Admin has changed your money


When you add the "\x**" byte, all letters in front of that will be a specific color

\x04 = green
\x01 = Normal color

I don't remember what \x02 and \x03 is... try it out...

_cyruss_
02-05-2008, 16:20
Hmm thanks!

Yep I knew there was \x01 but i thought it was just gray and a couple of different greens, didn't know you could get red and blue etc.. with that also

i will play around with it to see if i can get other colours...

if anyone has a colourlist that'd be cool ;)

p3tsin
02-06-2008, 09:50
\x01 = normal
\x02 = team color in player name only IIRC (dont use it :wink:)
\x03 = team color (ct = blue, terr = red, spec = grey, server = light green)
\x04 = green

For team colors you need to use the SayText usermessage cuz the color is dependant of the team the sender is on, except for light green of course.

EDIT: oh, this was for TF2... well you get the point.

_cyruss_
02-06-2008, 16:26
hmm yep i think i get it.. there seems to be a lot of greens in TF2, all different shades

so i take you can't use any colour you like, e.g. RGB values then.. only what Valve has built in game?

that kinda sucks.. booo valve ;)

_cyruss_
02-10-2008, 10:20
Okay i've got this working now how I want it with SayText2

my next question is, is it possible to do a SayText2 (where you can use team colour messages) but have the text only show up for that team? so a team say message as opposed to a message everyone can see

Nican
02-10-2008, 10:44
Well, what you can do is instead of sending the text to all, send the text to each individual the way you want.

_cyruss_
02-10-2008, 11:16
Well, you what you can do is instead of sending the text to all, send the text to each individual the way you want.

I understand, Thanks!:)

bl4nk
02-17-2008, 09:30
http://bl4nk.com/imgs/tf2_chat_colors1.jpg

You can achieve different results using SayText2() but I didn't feel like doing that at the time I took that screenshot. 07-09 do not appear btw.

SwInGeR
02-28-2008, 08:37
How can you have different colours in your chat message like this, see screenshot attached
Where to take this plugin?

HiJacker
08-24-2008, 15:42
Look here : http://forums.alliedmods.net/showpost.php?p=674783&postcount=4

And \x03 is WHITE Color :up: As you can see in that thread :)

V0gelz
08-25-2008, 06:00
Look here : http://forums.alliedmods.net/showpost.php?p=674783&postcount=4

And \x03 is WHITE Color :up: As you can see in that thread :)


Because server is white in TF2

DJ Tsunami
08-25-2008, 08:18
As I posted in that thread, it's not white at all. \x01 is white in TF2 and yellow in CS:S, \x03 is light green and \x04 is green.

pheadxdll
08-25-2008, 12:31
I'm going to bring this up again, because I still have some questions.

I used \x03 in PrintChatToAll and it didn't change the text to the color of the player. It would always be light green. I've read that you need to use SayText2 but I haven't seen any code with that used (and its not in Script Functions). Could anyone post an example on how to use it?

DJ Tsunami
08-25-2008, 14:06
http://forums.alliedmods.net/showthread.php?p=571160#post571160

But as said there, SayText2 doesn't work in every game (it does work in CS:S and TF2), so you can't have team colors in every game.

pheadxdll
08-25-2008, 15:55
Thanks, somehow I missed that post!

It seems like that only sends to one person. Should I loop through all the players to send the messages to everyone, or is there another way?

DJ Tsunami
08-25-2008, 18:05
You can use StartMessageAll instead of StartMessageOne and leave out the client index.

Trinidad
01-19-2010, 13:38
is there a way so send a colored sm_say via rcon to a server? if yes, how can you mark the colors in the string sent ( e.g. "\"+chr(1) ).

ThisIsNotMe
01-20-2010, 10:13
http://www.hayabusa.org/forum/attachments/busa-mods/167727d1259896953-loudest-exhaust-old_thread.jpg
also: look at this include (http://forums.alliedmods.net/showthread.php?t=96831)