AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   CS Color Chat Function Updated:[01/26/2007] (https://forums.alliedmods.net/showthread.php?t=45753)

teame06 10-10-2006 16:41

CS Color Chat Function Updated:[01/26/2007]
 
6 Attachment(s)
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);


k007 10-10-2006 19:13

Re: CS Color Chat Function
 
nice teame06

TheNewt 10-10-2006 19:40

Re: CS Color Chat Function
 
Very cool!

Zenith77 10-10-2006 20:19

Re: CS Color Chat Function
 
Code:
 static players[32]; new count, index;

How dare you put two statements on one line, you will now be punished severely.

teame06 10-10-2006 20:25

Re: CS Color Chat Function
 
Quote:

Originally Posted by Zenith77 (Post 389728)
Code:
 static players[32]; new count, index;

How dare you put two statements on one line, you will now be punished severely.

Gaben

Brad 10-11-2006 08:55

Re: CS Color Chat Function
 
For the lazy amongst us (me) can you show a screenshot or 3 of this in action?

Rolnaaba 10-11-2006 10:16

Re: CS Color Chat Function
 
nice *clap clap* makes me feel all warm and fuzzy inside :D

Silencer123 10-11-2006 16:30

Re: CS Color Chat Function
 
Well, nice, but not that new.
Keep up the good work, anyways.
;D

Zenith77 10-11-2006 18:45

Re: CS Color Chat Function
 
Code:
    if(!SayText)         SayText = get_user_msgid("SayText");

If you're going to set it, don't check it.

teame06 10-11-2006 19:16

Re: CS Color Chat Function
 
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.


All times are GMT -4. The time now is 21:14.

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