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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-10-2006 , 16:41   CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #1

The script below is a function I created for easier working with color chat with Counter-strike. ColorChat.sma is a sample plugin. This code is now only a code snippet now.

Quote:
/* Thanks for Damaged Soul for finding the information on how to do this.
http://forums.alliedmods.net/showthr...9604#post79604

This is code snippets I find useful.

^x01 is Yellow
^x03 is Team Color. Ie. Red (Terrorist) or blue (Counter-Terrorist) or grey (SPECTATOR or UNASSIGNED).
^x04 is Green

The colors red, grey, and blue can't be used on the same line. This is not possible at all to do.
Also there are limitation to using Red or Grey while on the TEAM CT.
You would have to do for example if they were on CT.

ColorChat(0, RED, "%s, ^x01This color is yellow. ^x03This color is red. ^x04This color is green.);

You have to set the Type to RED because of certain messages that need to be sent out so a person on the team CT can be sent red colors.

Some important information. When using MSG_ALL to send color message to all clients and your going to use blue/grey/red color sending the TeamInfo Message to tempoary change the player team to achieve this. You must send that message in MSG_ALL also. If your going to only send it to one person. You need to MSG_ONE on TeamInfo and SayText. (Thanks to CheapSuit I was able to see their was an error and fix it).

*/
Thanks to VEN and p3tsin (TeamInfo) for information to make this more usable colors on cs.

old_color_chat.sma is the old script. Just kept for informational. The new code is in ColorChat.sma

---------- Should not be need to use below any more --------

Quote:
Originally Posted by Extra Info from VEN
How to print Red for CT but it requires aleast one person connected and is on the Terrorist team. You just need to use the index of the Terrorist in the first argument. write_byte(TerroristPlayerIndex);

How to print Blue for Terrorist but it requires aleast one person connected and is on the Counter-Terrorist Team. You just need to use the index of the Terrorist in the first argument. write_byte(Counter-TerroristPlayerIndex);
Attached Thumbnails
Click image for larger version

Name:	SS_ColorChat.jpg
Views:	7289
Size:	36.7 KB
ID:	11814  
Attached Files
File Type: sma Get Plugin or Get Source (old_color_chat.sma - 4079 views - 2.2 KB)
File Type: sma Get Plugin or Get Source (ColorChat.sma - 6780 views - 4.2 KB)
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 01-26-2007 at 20:00.
teame06 is offline
Send a message via AIM to teame06
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-10-2006 , 19:13   Re: CS Color Chat Function
Reply With Quote #2

nice teame06
k007 is offline
Send a message via MSN to k007
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 10-10-2006 , 19:40   Re: CS Color Chat Function
Reply With Quote #3

Very cool!
__________________
Quote:
toe3_ left the chat room. (G-lined (AUTO Excessive connections from a single host.))
TheNewt is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-10-2006 , 20:19   Re: CS Color Chat Function
Reply With Quote #4

Code:
static players[32]; new count, index;

How dare you put two statements on one line, you will now be punished severely.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-10-2006 , 20:25   Re: CS Color Chat Function
Reply With Quote #5

Quote:
Originally Posted by Zenith77 View Post
Code:
static players[32]; new count, index;

How dare you put two statements on one line, you will now be punished severely.
Gaben
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 10-11-2006 , 08:55   Re: CS Color Chat Function
Reply With Quote #6

For the lazy amongst us (me) can you show a screenshot or 3 of this in action?
__________________
Brad is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-11-2006 , 10:16   Re: CS Color Chat Function
Reply With Quote #7

nice *clap clap* makes me feel all warm and fuzzy inside
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Location: Germany (GMT+1)
Old 10-11-2006 , 16:30   Re: CS Color Chat Function
Reply With Quote #8

Well, nice, but not that new.
Keep up the good work, anyways.
;D
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-11-2006 , 18:45   Re: CS Color Chat Function
Reply With Quote #9

Code:
    if(!SayText)         SayText = get_user_msgid("SayText");

If you're going to set it, don't check it.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-11-2006 , 19:16   Re: CS Color Chat Function
Reply With Quote #10

Quote:
Originally Posted by Zenith77
If you're going to set it, don't check it.
Memory checking vs running that native. I would rather do memory check than run the native over every time this function was used when the value was stored.
__________________
No private support via Instant Message
GunGame:SM Released
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 20:00.


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