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.

Arion 11-25-2007 16:07

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

Originally Posted by connorr (Post 556739)
Some plugins just check if some keywords are said by players.

In these cases you should put admin_chat_colors.amxx in the end of plugins.ini

(Y)

Tartooob 11-26-2007 04:17

Re: Admin Chat Colors [v1.2 - 25/11/2007]
 
Wow nice, Gonna test it out ^^

Arion 11-26-2007 07:20

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
Angelina, it's because this plugin handles "say " and "say_team " messages and stops. Try the new version, on first page.

I only changed returns from PLUGIN_HANDLED to PLUGIN_HANDLED_MAIN. That should prevent any conflict with other plugins.

Thanks connorr for helping with this

Arion 11-26-2007 07:50

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
Angelina, if you can edit the .sma file, change all PLUGIN_HANDLED_MAIN to PLUGIN_CONTINUE and see if it works

Owyn 11-26-2007 09:03

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
can u make this compitable with amx_translit ?

Arion 11-26-2007 09:18

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
@Angelina, that's why I was afraid of PLUGIN_CONTINUE.. I knew it would probably make the message appear twice..


@Owin, what's exactly the problem?

Arion 11-26-2007 09:42

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
I don't know how to fix.. If the messages goes to HLSW (through PLUGIN_CONTINUE), it will go to engine aswell, which will cause the message to appear twice.. If you block it for going (through PLUGIN_HANDLED), it won't appear in HLSW..

Arion 11-26-2007 13:52

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
Angelina, yes, deactive for a while.

I installed HLSW and I'm trying to fix.

`666 11-26-2007 14:18

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
yer, for some reason doesnt log chat in to cs logs :S maybe because i got antibigot plugin, not sure...

ConnorMcLeod 11-26-2007 14:19

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
Don't know if this is related :
Quote:

Originally Posted by "adminchat.sma
Code:
    if (message[0] == '"' && message[length] == '"') // HLSW fix     {         message[0] = ' '         message[length] = ' '         length += 2     }


Arion 11-26-2007 14:29

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
I didn't get your point, connorr..


@Angelina, bad news.. I don't know how to fix.. You must choose either colored messages or see messages in HLSW ;/

@666 Same case as Angelina..

Arion 11-26-2007 19:22

Re: Admin Chat Colors [v1.2 - 26/11/2007]
 
@Angelina

Thanks! I'll study the code and (I hope) make a definitive solution.


Edit.

I don't know how, but I found a solution. Luck, I guess.

I only changed all returns to PLUGIN_CONTINUE, added this to plugin_init():
register_message (get_user_msgid ("SayText"), "avoid_duplicated")

and in function avoid_duplicated, this:
return PLUGIN_HANDLED

And voilą! Prints in chat (once), server console, HLSW, and doesn't interfere on other plugins anymore. Want more?

`666 11-27-2007 14:13

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
thanks for bug fix!

Owyn 11-27-2007 14:34

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
Quote:

and doesn't interfere on other plugins anymore
doesn't interfere with other plugins which hooks say cmd?

Arion 11-27-2007 14:35

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
Quote:

Originally Posted by .Owyn. (Post 557518)
doesn't interfere with other plugins which hooks say cmd?

Exactly.. It should not interfere..

If you enconter any problems, please let me know.

Owyn 11-27-2007 14:43

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
just did. if i turn amx_translit ON, and then i try to say something using say or team_say nothing appears in chat.

+plus, btw, can u add silver color?

Alka 11-27-2007 14:46

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
Try to put translit before this plugin in plugins.ini , should work.

Owyn 11-27-2007 15:00

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
did, now text appears but doesn't translits (but i see translited text in console, then not translited (2msgs from 1 msg))

+could u edit translit.sma so it would work with your plugin together?
+btw, can u make admin names colored too?

Owyn 11-27-2007 15:20

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
there was a plugin that was changing name colors, but it doesn't work now, but i saw screens anyway :O

Arion 11-27-2007 18:02

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
@Owyn, silver color you mean white/gray? amx_color 3

I don't know how to fix this issue with translit right now.. Maybe if you PM me with all specifications I could give try..

@Angelina, I think the spec bug could not be fixed.. But there aren't many people who talks as spectator anyway.


I could add a command to change name color, but I'm in my tests week, so please be patient

Owyn 11-28-2007 07:25

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
Quote:

white/gray? amx_color 3
i tried all colors, 3 as i remember is white

Quote:

I could add a command to change name color, but I'm in my tests week, so please be patient
k, we'll be waiting ^_^

-pmed u

CAMEL 12-03-2007 23:25

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
I like the plug, but can u make another but that the admin chat in white and special chat, like the white chat for admins don't dessapear.. =S... Because my admins don't like speaking like normal users =)... Lol. But well, I tried to edit the sma, but i didnt find the place of the admin chat..

waka-boy 12-04-2007 20:40

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
HEY bro this plugin no work, tested by 2 admins in my server no work only 1 admin see the msg, i need the version 1.2 please post it :wink:

bmann_420 12-05-2007 10:50

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
A birth of another one ehy. :D And that HANDLED_MAIN really works? That would change a few things in quite a few plugins if it did. But good work Arion, I know this is like the 4th version tho, even if it is from scratch. :up:

Arion 12-05-2007 21:55

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
bmann, I changed HANDLED_MAINs to PLUGIN_CONTINUEs on a early update, to fix incompatibilities with other plugins which handles users say and say_team.

Yep, I know there's another plugins who change in some way the color of messages, but none of them change also the name.. Not this yet, but the code is ready, I just need to test it.

@CAMEL:
all chat messages disappear in some seconds.. There is no way to avoid that

@waka-boy:
I'm developing a new version and I'll test it until no errors occur

bmann_420 12-06-2007 01:50

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
Well, if that worked, then per say admin_slash (amx_) prefix would fix that issue of the "bottom of the list" type of thing. If...

Darkless 12-07-2007 11:55

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
this plugin dont work for cstrike 1.5 and 1.6 :down:

waka-boy 12-07-2007 17:31

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
@Darkless
wait for the new version bro.

@Arion
It posible you send me the version 1.2 by pm

This is nice plugin! :up:

Arion 12-10-2007 10:05

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
@Darkless
It do work on 1.6

@waka-boy
I haven't v1.2 anymore, why would you want it?

waka-boy 12-10-2007 16:25

Re: Admin Chat Colors [v1.3 - 27/11/2007]
 
Arion -> v1.2 This version Works perfectly with me


All times are GMT -4. The time now is 20:22.

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