Raised This Month: $51 Target: $400
 12% 

client_print with colors or team color?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
larnk
Member
Join Date: Dec 2004
Old 01-03-2005 , 07:19   client_print with colors or team color?
Reply With Quote #1

client_print is a wide used function, But How to print messages with Color? just like Say, the username is team colored.

Thanks
larnk is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-03-2005 , 13:27  
Reply With Quote #2

I'd imagine that since HL (or at least CS) supports colored say messages like that there would have to be some way to modify MetaMod or AMXx to allow it.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 01-03-2005 , 15:17  
Reply With Quote #3

I honestly don't think a method currently exists. I think the client determines the colors based on the name. Meaning if the message begins with a player's name, then it will make it the color of that player's team.
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 01-03-2005 , 16:33  
Reply With Quote #4

it is possible
i have requested it over a month ago
here
__________________
alias White Panther
karlos is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 01-03-2005 , 17:21  
Reply With Quote #5

Quote:
Originally Posted by karlos
it is possible
i have requested it over a month ago
here
The code that you are referring to comes from the client DLL. You can't access pfnDrawSetTextColor server-side. It's a client-side function and just wouldn't work from AMXX or any Metamod plugin for that matter.
__________________
エル・プサイ・コングルゥ
DS is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 01-03-2005 , 17:33  
Reply With Quote #6

wrong again!

You can access the client DLL through messages. Make the right message, change the color of the text.

Now...if only we knew which one to use, how to ue it,ect ect.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 01-03-2005 , 18:05  
Reply With Quote #7

Like I said, you can't access pfnDrawSetTextColor server-side...

Yes, there are messages, such as SayText. But there are not any arguments for dealing with color for such a message. If a mod had such a message for printing normal text (not HUD text) in different colors, then of course something like that would be possible. But in CS, that doesn't seem to be the case. You'd have to use HUD messages to use different colors...

Messages aren't exactly direct access to the client anyways. The client DLL has hooks/callbacks set up for what to do when a message is received from the server. I would agree with Geesu here that the client determines the color based on what team the talking player is on.

When a player talks with say or say_team, that information is sent to the server. The server then will send a SayText message to all clients that should be able to see that message, which would be different depending on whether or not that player is dead or if he or she used say_team. The client DLL must have a hook set up for SayText. So when the client receives the SayText message from the server, it will determine how that text should be displayed on the player's screen. The first argument of SayText is the entity index of the player who sent the message. The client DLL must use that information to determine what team the player is on and then use the appropriate color. Then after that, it's actually displayed on the player's screens.
__________________
エル・プサイ・コングルゥ
DS is offline
larnk
Member
Join Date: Dec 2004
Old 01-03-2005 , 18:32  
Reply With Quote #8

in fact, some one has done it. I connec to a server and the welcome message is a colored chat message.
but I do not know to do
Attached Thumbnails
Click image for larger version

Name:	de_survivor0000.jpg
Views:	2840
Size:	155.5 KB
ID:	2103  
larnk is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 01-03-2005 , 18:56  
Reply With Quote #9

Damaged Soul as u said its a dll
amxmodx is a dll too
so i think it is possible to implement it

and the picture larnk posted seems to be a proof
__________________
alias White Panther
karlos is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 01-03-2005 , 20:05  
Reply With Quote #10

Ok, well I have learned something new here then. However, if appears you still can't use colors other than blue, red, white (spectator), or the normal text color (meaning you can't specify colors other than the ones available in CS). That sort of thing still appears to be handled by client DLL.

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.
__________________
エル・プサイ・コングルゥ
DS is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode