AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Chat Manager [Admin Prefix & Color Chat] (https://forums.alliedmods.net/showthread.php?t=297952)

OciXCrom 05-28-2017 10:34

Chat Manager [Admin Prefix & Color Chat]
 

Description
  • The best of its kind plugin that allows you to take full control over your in-game chat. With this plugin you can add admin prefixes, custom player prefixes, different chat color for each player, different chat styles, colored names, change the team prefixes, change the dead prefix, add a prefix for alive players, add city and country, show the IP and SteamID in chat, date and time, log the chat and many more!

Information
  • You will find two plugins in the archive. The first one (crx_chatmanager) is the main plugin, and the second one (crx_chatmanager_toggle) contains the command /cm that allows players to turn on/off their prefix, chat color and custom name. There's no need to add the second plugin if you don't want players to have access to such settings.

Commands
  • The only command found in the main plugin is the command cm_reload that allows admins to immediately reload the configuration file.

Main settings
  • The main settings can be found in the [Main Settings] section in the file configs/ChatManager.ini.
  • ALL_CHAT -- if set to 1, all players will see all chats independant of whether they are dead or alive, this won't let them view the other team's private chat however; setting it to 2 will let them view the team chats as well
  • ADMIN_LISTEN_FLAGS -- players with this flag (or these flags) will be able to see all chats at all time
  • ADMIN_LISTEN_TEAM_CHAT -- whether players with the admin listen flag will be able to see the opposite team's chat
  • GLOBAL_CHAT_FLAG -- when a player with this flag writes in chat, it will be visible for all players at all times
  • GLOBAL_CHAT_TEAM -- whether players with global chat will be visible when writing in their team's private chat
  • BLOCK_FIRST_SYMBOLS -- messages starting with these symbols will be hidden in chat (you can use this to hide messages starting with "/")
  • DEAD_PREFIX -- the prefix for dead players (*DEAD*)
  • ALIVE_PREFIX -- the prefix for alive players (you can leave it blank)
  • SPEC_PREFIX -- the standard *SPEC* prefix for spectators
  • TEAM_PREFIX_T -- (Terrorist) prefix
  • TEAM_PREFIX_CT -- (Counter-Terrorist) prefix
  • TEAM_PREFIX_SPEC -- (Spectator) prefix
  • ERROR_TEXT -- what will show up when an invalid value is recieved
  • FORMAT_TIME -- how to show the time when using %time% (more info here)
  • CHAT_LOG_FILE -- chat messages will be logged in this file; leave it blank if you want to disable logging
  • CHAT_LOG_SAY_FORMAT -- the format that will be used when logging messages from the say chat
  • CHAT_LOG_TEAM_FORMAT -- the format that will be used when logging messages from the say_team chat
  • SAY_SOUND -- here you set a sound that will be played when sending a message in the say chat
  • SAY_TEAM_SOUND -- here you set a sound that will be played when sending a message in the say_team chat
  • EXPIRATION_DATE_FORMAT -- date format used with expiration dates (more info here)
  • EXPIRATION_DATE_BEHAVIOR -- what to do when the date for a specific extra has expired - 0 = ignore the entire line; 1 = put a "#" symbol in the beginning of the line; 2 = remove the entire line from the file
  • COLORCHAT_FLAG -- players with this flag can use color codes in their message (&x01, &x03, &x04) in order to modify their message color
  • SAY_METHOD -- whether the plugin will hook the "say" and "say_team" commands or the "SayText" message

Adding prefixes, chat colors and custom names
  • These things can be added in the [Admin Prefixes], [Chat Colors] and [Name Customization] sections.
  • The names are pretty self-explainatory, so I don't think that additional instructions are needed.
  • You can find examples and a syntax in the .ini file.
  • A new prefix, color or name can be added on a new line in the respective section.
  • When adding something, you can choose if you want to add it on a certain flag, name, IP address, etc.
  • In the list down below you will find all types of data that can be used when adding an extra.
    • flag -- adds the extra if the player has all of the flags specified in the "info" argument
    • anyflag -- adds the extra if the player has at least one of the flags specified in the "info" argument
    • name -- adds the extra if the player's name is equal to the one specified in the "info" argument
    • ip -- adds the extra if the player's IP address is equal to the one specified in the "info" argument
    • steam -- adds the extra if the player's SteamID is equal to the one specified in the "info" argument
    • noprefix -- adds the extra if the player doesn't have a prefix
  • For example, if you write "flag" "mnop" "[VIP]", players with flags "mnop" will receive the prefix [VIP].
  • If a player meets the requirements for more than one prefix/color/name, he will get the one that's highest in the list.
  • You can also set an expiration date for the extras by adding the expiration date in the end of the line. For example, if you want to add a prefix for the player named OciXCrom that will expire on 20.09.2019, you need to type "name" "OciXCrom" "[Prefix]" "20.09.2019" on a new line in the [Admin Prefixes] section.

Defining chat formats
  • Formats determine how the chat is going to look. You can set a different chat style for each player in the [User Formats] section, but first you need to define the formats in the [Format Definitions] section. You can use the following placeholders when defining formats:
    • $admin_prefix$ -- the admin prefix set in the [Admin Prefixes] section
    • $dead_prefix$ -- *DEAD* prefix (and the alive one, if set)
    • $team$ -- player's team
    • $name$ -- player's real name
    • $custom_name$ -- player's custom name set in the [Name Customization] section
    • $ip$ -- player's IP address
    • $steam$ -- player's SteamID
    • $userid$ -- player's userid
    • $chat_color$ -- player's chat color set in the [Chat Colors] section
    • $message$ -- the actual message
    • $time$ -- time/date
  • You can also use the following ones, but since they are disabled by default, you need to enable them in the .sma file. To enable a placeholder, you need to remove the "//" from the line that contains #define in the beginning of the file, and recompile the plugin after.
    • $health$ -- player's health
    • $armor$ -- player's armor
    • $frags$ -- player's frags
    • $deaths$ -- player's deaths
    • $city$ -- player's city
    • $country$ -- player's country
    • $country_code$ -- player's country code
    • $continent$ -- player's continent
    • $continent_code$ -- player's continent code

Color codes list
  • &x07 = red
  • &x06 = blue
  • &x05 = grey
  • &x04 = green
  • &x03 = team color
  • &x01 = default

Additional information and download link

https://raw.githubusercontent.com/Oc...using_this.png
https://raw.githubusercontent.com/Oc...plugin_lab.png
https://raw.githubusercontent.com/Oc...ad_default.png

Ayman Khaled 05-28-2017 10:43

Re: Chat Manager [Admin Prefix & Color Chat]
 
Nice!

DevilBoy.eXe 05-28-2017 10:51

Re: Chat Manager [Admin Prefix & Color Chat]
 
Very nice plugin, GJ ;)
But I want to know if it has something different from this plugin
https://forums.alliedmods.net/showthread.php?p=556619

OciXCrom 05-28-2017 10:58

Re: Chat Manager [Admin Prefix & Color Chat]
 
Quote:

Originally Posted by DevilBoy.eXe (Post 2524199)
Very nice plugin, GJ ;)
But I want to know if it has something different from this plugin
https://forums.alliedmods.net/showthread.php?p=556619

1. It has prefixes. o_O
2. It's not hard-coded.
3. It has an unlimited number of possible combinations, rather than only 6 controlled by a cvar.
4. It can show the IP and/or SteamID in chat.
5. It can show the current time in chat.
6. You can change the *DEAD* prefix.
7. You can add an *ALIVE* prefix.
8. You can change the team prefixes.
9. You can change the admin listen flag.
10. You can hide messages starting with /, @, etc...
11. You can entirely change how chat messages look.
12. It's much better coded.
13. I got tired of counting...

kristi 05-28-2017 13:56

Re: Chat Manager [Admin Prefix & Color Chat]
 
Add %userid% and a command to reload settings file.

OciXCrom 05-28-2017 14:02

Re: Chat Manager [Admin Prefix & Color Chat]
 
Quote:

Originally Posted by kristi (Post 2524259)
Add %userid% and a command to reload settings file.

I added %userid%, but I won't add any commands for now.

HamletEagle 05-28-2017 15:43

Re: Chat Manager [Admin Prefix & Color Chat]
 
Spoiler

Should always make sure that the current plugin is always the last in plugins.ini
I did not test it, and it may not be the best implementation, but I did it only for fun and in a rush. Use something like this if you want.

OciXCrom 05-28-2017 15:47

Re: Chat Manager [Admin Prefix & Color Chat]
 
I was thinking of something like that, but when I thought about additional plugins-something.ini files, I gave up on the idea. There's probably a way to check if the plugin is last by using get_plugins functions.

HamletEagle 05-28-2017 15:51

Re: Chat Manager [Admin Prefix & Color Chat]
 
Quote:

Originally Posted by OciXCrom (Post 2524294)
I was thinking of something like that, but when I thought about additional plugins-something.ini files, I gave up on the idea. There's probably a way to check if the plugin is last by using get_plugins functions.

You can check my Auto Plugin Adder to see a way to also handle all this files. I may edit the above function and handle the other cases, if I find time.

I am not sure how AMXX handles plugins internally, but if it simply gives them indexes from 0 to maxplugins, then retrieving current plugins index and using get_pluginsnum may do the trick. You could test.

OciXCrom 05-28-2017 15:54

Re: Chat Manager [Admin Prefix & Color Chat]
 
Yup, that's what I tought. If plugin_index == get_pluginsnum should work. I'll check tomorrow.


All times are GMT -4. The time now is 18:51.

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