Raised This Month: $7 Target: $400
 1% 

Admin Chat Colors [v2.0 - 12/10/2007]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
Arion
Senior Member
Join Date: Mar 2007
Old 11-25-2007 , 10:34   Admin Chat Colors [v2.0 - 12/10/2007]
Reply With Quote #1

Admin Chat Colors
by Arion


Description:
Chat messages from admins with the defined access level (default ADMIN_CHAT) will have a different name and message colors from normal players.
Plus admins with the defined access level (default ADMIN_BAN) will see all players' messages, including alive and dead players and teamsay from the other team.



Cvars/Commands (Default Access Level: ADMIN_CHAT):
amx_namecolor <color>
Name colors: [1] Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-Color
Changes the name color of all admins
Default: 6


amx_color <color>
Message colors: [1] Yellow, [2] Green, [3] White, [4] Blue, [5] Red
Changes the message color of all admins
Default: 2


Therefore, default admins' chat color will be:
Team-Color Name : Green Message

Also, messages of normal players will be in the following format so it's easy to differ admins from normal players by their color:
Team-Color Name : Yellow message


amx_listen <1 | 0>
Either allow/prohibit admins from seeing all live, dead and team-only messages, regardless they are alive or dead, or which team they are.
Default: 1


Note: The plugin will handle color changing properly in order to avoid messages which contains Red, Blue,
and White together (This isn't possible due an engine limitation). In these cases, either name or message color will be changed to green.


Changelog:
Code:
v1.0 [11/25/2007] Initial Release
v1.1 [11/25/2007] + Added pcvar to activate/deactivate Admin Listen
                  $ Optimized cvars to pcvars
v1.2 [11/26/2007] X Tried changing returns from HANDLED to HANDLED_MAIN, to avoid conflicts with other plugins which handle messages. No success.
v1.3 [11/27/2007] X Fixed bug where messages were not appearing in HLSW.
                  X Fixed conflict problems. Should not interfere in others pluginn anymore.
v2.0 [12/10/2007] ^ Major update. Almost entirely rewritten to support name color change feature.


Although it has been hardly tested, if you find any bug, please report it to me.


Screenshots:
Attached Thumbnails
Click image for larger version

Name:	admin_chat_colors.jpg
Views:	194201
Size:	39.7 KB
ID:	21733   Click image for larger version

Name:	admin_chat_colors_2.jpg
Views:	166290
Size:	57.1 KB
ID:	21734  
Attached Files
File Type: sma Get Plugin or Get Source (admin_chat_colors.sma - 165926 views - 10.4 KB)
__________________

Last edited by Arion; 12-10-2007 at 22:01.
Arion is offline
Send a message via MSN to Arion
Old 11-25-2007, 11:01
ConnorMcLeod
This message has been deleted by Emp`. Reason: This isn't Scripting Help
Old 11-25-2007, 11:35
Arion
This message has been deleted by Emp`. Reason: This isn't Scripting Help
Old 11-25-2007, 11:39
Sylwester
This message has been deleted by Emp`. Reason: This isn't Scripting Help
Old 11-25-2007, 11:40
ConnorMcLeod
This message has been deleted by Emp`. Reason: This isn't Scripting Help
dangerix
Senior Member
Join Date: Aug 2007
Location: Germany
Old 11-25-2007 , 11:51   Re: Admin Chat Colors [v1.0 - 25/11/2007]
Reply With Quote #2

connorr, you're too slow today ;p

Arion, please be so kind and add CVARs for the chat messages, so you can choose which ones (alive, dead, teamsay) to be shown to the admins when they are alive / dead / spec.

And add a CVAR to enable / disable the plugin, either :o
__________________
dangerix is offline
Arion
Senior Member
Join Date: Mar 2007
Old 11-25-2007 , 11:54   Re: Admin Chat Colors [v1.0 - 25/11/2007]
Reply With Quote #3

Thanks for the documentation, I'll take a good look at it.

@dangerix:
Don't you want to see all other players' messages? <evul

There is already a cvar to enable/disable the plugin: amx_color 1 (Plugin won't even touch the message)
__________________
Arion is offline
Send a message via MSN to Arion
Arion
Senior Member
Join Date: Mar 2007
Old 11-25-2007 , 12:13   Re: Admin Chat Colors [v1.0 - 25/11/2007]
Reply With Quote #4

Update: Now plugin restores previous amx_color value after closing server.. When I type amx_colors in the console, it says that is 2 (green) but my messages are blue as it was 4. How to fix that?

Updated plugin with pcvar (;)) amx_listen. Set it to 0 and admins won't see improper messages anymore.
__________________

Last edited by Emp`; 11-25-2007 at 15:49. Reason: This isn't Scripting Help
Arion is offline
Send a message via MSN to Arion
dangerix
Senior Member
Join Date: Aug 2007
Location: Germany
Old 11-25-2007 , 12:20   Re: Admin Chat Colors [v1.0 - 25/11/2007]
Reply With Quote #5

Quote:
Originally Posted by Arion View Post
@dangerix:
Don't you want to see all other players' messages? <evul
At least, I'd like to decide on my own. I'm not sure yet whether I'm going to use this plugin, but if so, I could change the access level anyway.
I don't want all of my admins to be able to see the other team's teamsay.

Quote:
Originally Posted by Arion View Post
There is already a cvar to enable/disable the plugin: amx_color 1 (Plugin won't even touch the message)
Oh, missed that. My fault.

//edit:
get_pcvar_num
__________________
dangerix is offline
Old 11-25-2007, 13:13
Arion
This message has been deleted by Emp`. Reason: This isn't Scripting Help
Old 11-25-2007, 13:21
Alka
This message has been deleted by Emp`. Reason: This isn't Scripting Help
Arion
Senior Member
Join Date: Mar 2007
Old 11-25-2007 , 13:35   Re: Admin Chat Colors [v1.1 - 25/11/2007]
Reply With Quote #6

Thanks Alka

After some testings I understood how it works.
Updated.
__________________
Arion is offline
Send a message via MSN to Arion
Old 11-25-2007, 15:51
Angelina
This message has been deleted by Emp`. Reason: Read what I just posted.
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-25-2007 , 15:51   Re: Admin Chat Colors [v1.2 - 25/11/2007]
Reply With Quote #7

Might want to add in the main post that this plugin should be one of the last to load (near/at the bottom of plugins.ini) because it will block any say commands for plugins loaded after it.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-25-2007 , 15:56   Re: Admin Chat Colors [v1.2 - 25/11/2007]
Reply With Quote #8

return PLUGIN_HANDLED_MAIN should prevent such an issue.
ConnorMcLeod is offline
Old 11-25-2007, 15:56
Angelina
This message has been deleted by Angelina.
Arion
Senior Member
Join Date: Mar 2007
Old 11-25-2007 , 16:04   Re: Admin Chat Colors [v1.2 - 25/11/2007]
Reply With Quote #9

Plugin won't handle messages which start with:
@
(admin hud messages)
/ (admin slash commands)
! (GunGame commands)
(empty messages)

This is supposed to prevent conflicts..

What does return PLUGIN_HANDLED_MAIN do exactly?
__________________
Arion is offline
Send a message via MSN to Arion
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-25-2007 , 16:06   Re: Admin Chat Colors [v1.2 - 25/11/2007]
Reply With Quote #10

Some plugins just check if some keywords are said by players.
ConnorMcLeod is offline
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 10:05.


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