View Single Post
larnk
Member
Join Date: Dec 2004
Old 01-03-2005 , 22:21  
Reply With Quote #13

Quote:
Originally Posted by Damaged Soul
I did some searching around and came across this:

Code:
// Radio and chat strings can have control characters embedded to set colors.  For the control characters to be used, one must be at the start of the string.
// The control characters can be copied and pasted in notepad.
//  = 0x02 (STX) - Use team color up to the end of the player name.  This only works at the start of the string, and precludes using the other control characters.
//  = 0x03 (ETX) - Use team color from this point forward
//  = 0x04 (EOT) - Use location color from this point forward
//  = 0x01 (SOH) - Use normal color from this point forward
Some of those characters won't appear there. But its simple.

Code:
public plugin_init() {     register_clcmd("test","test") } public test(id) {     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)     write_byte(id)     write_string("^x03Team colored text ^x01Normal color")     message_end()         return PLUGIN_HANDLED }

The team colored text will print in red if the entindex is of a player on the T team or blue if the entindex of a player on the CT team. Otherwise it will print in white. I also noticed if you use x^04 instead for the "location color", it will print in green text. So it seems you can print text in red, blue, white, or green. That's all that is available for CS anyways. The colors don't seem to work in anything else other than the SayText message, but I could be wrong about that.
Thank you very much. It works well.
Best regards.
larnk is offline