Raised This Month: $32 Target: $400
 8% 

CS Color Chat Function Updated:[01/26/2007]


Post New Thread Reply   
 
Thread Tools Display Modes
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-11-2006 , 21:06   Re: CS Color Chat Function
Reply With Quote #11

I would just set it once and keep it static or make it global.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
mpDOTcain
Member
Join Date: Jul 2006
Old 10-11-2006 , 21:06   Re: CS Color Chat Function
Reply With Quote #12

very nice, thanks tons.
mpDOTcain is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-12-2006 , 01:09   Re: CS Color Chat Function
Reply With Quote #13

Quote:
Originally Posted by Zenith77 View Post
I would just set it once and keep it static or make it global.
Yes, make it global would be the most efficent. On you saying it I would just set it once and keep it static will not work propertly. The reason behind this is that you can't do.

Code:
static SayText = get_user_msgid("SayText");

and if you do this.

Code:
static SayText; SayText = get_user_msgid("SayText"); // Then this will still called the native over every time you call the function.

There is only two ways too do this want to do of efficiency. Too do it global or the way I did it because if I did it the way you were saying at first then I would just do it the way below.

Code:
message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, id)
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
BAILOPAN
Join Date: Jan 2004
Old 10-12-2006 , 01:50   Re: CS Color Chat Function
Reply With Quote #14

teame06's usage is correct ;) the "don't check if set" rule doesn't apply if skipping the check is less expensive than actually setting.
__________________
egg
BAILOPAN is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-12-2006 , 09:30   Re: CS Color Chat Function
Reply With Quote #15

I'd still keep it global -.-. Anyways, I'm not going to argue/debate anymore over something this small, I just like picking at others people code, wish I would have the ability to do that to my own code.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-25-2006 , 05:06   Re: CS Color Chat Function
Reply With Quote #16

I don't know whether my finding are new or not but if you want to expand this to be able to type, for example, in red for CT you can specify T-player index as the first message argument. Of course at least one T-player on the server needed for that.

Last edited by VEN; 10-25-2006 at 05:08.
VEN is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-25-2006 , 18:22   Re: CS Color Chat Function
Reply With Quote #17

@ VEN

I knew about it but I didn't want to add it since it requires the player index of a player on the terrorist team or counter-terrorist. Since it informational I have added it at the bottom as extra info. Thanks
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 10-31-2006 , 07:23   Re: CS Color Chat Function
Reply With Quote #18

Quote:
Originally Posted by VEN View Post
I don't know whether my finding are new or not but if you want to expand this to be able to type, for example, in red for CT you can specify T-player index as the first message argument. Of course at least one T-player on the server needed for that.
u can also pick a random player and then use TeamInfo event to "transfer" him into the desired team, do the SayText event and then "transfer" him back
this way u can do all of the colors whenever u want to (tho only one teamcolor per line ofc)
__________________
plop
p3tsin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-31-2006 , 10:12   Re: CS Color Chat Function
Reply With Quote #19

p3tsin: i tryed cs_set_user_team but it didn't worked instantly (about 5 x PreThinks), didn't thought about TeamInfo, nice finding.
VEN is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 11-06-2006 , 19:29   Re: CS Color Chat Function
Reply With Quote #20

Updated.

Usable colors now are Grey, Green, Red, Blue, Yellow or team color. Check the new Screen shots too see how the colors look like


Commands to see the colors are since there two many lines to print at once:
say /test
say /test2
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 11-06-2006 at 19:40.
teame06 is offline
Send a message via AIM to teame06
Reply


Thread Tools
Display Modes

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 05:37.


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