AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Admin Chat Colors [v2.0 - 12/10/2007] (https://forums.alliedmods.net/showthread.php?t=63610)

Arion 11-25-2007 10:34

Admin Chat Colors [v2.0 - 12/10/2007]
 
3 Attachment(s)
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:

dangerix 11-25-2007 11:51

Re: Admin Chat Colors [v1.0 - 25/11/2007]
 
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

Arion 11-25-2007 11:54

Re: Admin Chat Colors [v1.0 - 25/11/2007]
 
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 11-25-2007 12:13

Re: Admin Chat Colors [v1.0 - 25/11/2007]
 
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.

dangerix 11-25-2007 12:20

Re: Admin Chat Colors [v1.0 - 25/11/2007]
 
Quote:

Originally Posted by Arion (Post 556644)
@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 (Post 556644)
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

Arion 11-25-2007 13:35

Re: Admin Chat Colors [v1.1 - 25/11/2007]
 
Thanks Alka

After some testings I understood how it works.
Updated.

Emp` 11-25-2007 15:51

Re: Admin Chat Colors [v1.2 - 25/11/2007]
 
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.

ConnorMcLeod 11-25-2007 15:56

Re: Admin Chat Colors [v1.2 - 25/11/2007]
 
return PLUGIN_HANDLED_MAIN should prevent such an issue.

Arion 11-25-2007 16:04

Re: Admin Chat Colors [v1.2 - 25/11/2007]
 
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?

ConnorMcLeod 11-25-2007 16:06

Re: Admin Chat Colors [v1.2 - 25/11/2007]
 
Some plugins just check if some keywords are said by players.


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

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