amx_pm
This is a simple little plugin i threw together. It allows users to private message each other in the server, restricting dead clients to talk to live ones, and anyone to talk to bots. (with a CVAR to allow them to do so) It includes colored messages, chat command, console command, and a defined pm sound that plays when a user receives a message. Fast and easy to use, you simply put an exclamation mark (!) before the person's name who you want to message, a space, and then what you want to say to them. If you just want to get their attention you can send a page simply by "!<username>" and it will send a message saying...
The message will then display in that user's chat area, proceeded with a green [PM] tag, as shown above. All messages are sent to both parties (sender and receiver) while only the receiver gets a sound notification. Messages to or from admins are delivered weather the sender has PMs toggled off or not, or if a certain admin has that sender blocked. Admins override these precedences and do not recieve messages if they do not wish to. If a user has Private Messages turned off they can neither send nor recieve PMs from other plyaers, unless using console commands, or an admin PMs them.
There is also the ability for users to block other users and toggle Private Messages on and off entirely. These functions are accessable from a menu (done by /pm) or using a command. The menu also provides a help MOTD for users who want to know commands on the fly, who they've blocked, if they have Private Messages enabled, and weather or not they are banned.
All clients' commands are done in say messages (default y in game) and admin commands are doen in team_say messages (default u in game). Admins are defined by admin flag (default ADMIN_KICK) and can be easily change in source code by editing
ADMIN_FLAG define and re-compiling.
<CVARs>
private_message 0 // <-1|0|1> -1: turns off the plugin entirely, 0: doesn't allow dead users to talk to live ones, 1: allows anyone to PM anyone else.
pm_sound "buttons/blip2.wav" // The file path to the sound you wish to play when a user gets PM'd. Leave the quotes empty to turn this feature off.
Context: <..> Is a variable i.e. user's name/#id or message and [..] means it is not required for the command and can be left out
<Client Commands> (all client commands done in say)
!<username> [<message>] -Sends a message to the specified user. Without a message the user is just paged.
!admin [<message>] -Sends all admins a message. Without message all admins get paged. All messages sent in this manner prefix the message with [TO ADMIN]
/pm -Displays the amx_pm menu. This allows clients to toggle Private Messages, block users, page admins, read a help prompt, and give an admin menu to ban users from using PM.
/pm [on|off|block|help] -PM menu shortcuts (toggle on/off, block user menu, help prompt)
/pageadmin -Pages all admins (this is really just to get their attention)
/block [<username>] -This blocks the specified user. Without the username, or with an invalid user, a menu will appear with all valid players. You can block them from there.
This feature can be removed by commenting out INVALIDPLAYERMENU define.
<Console Commands>
amx_pm <username> <message> -This allows you to override your disenablement of Private Messages and send a message to the specified username.
pm_menu -This displays the Private Message menu to the user.
pm_block <username> -This allows clients to block the specified user. (no access to block menu)
<Admins Commands> (all admin commands done in team_say)
/admin <username> [<message>] -Sends an admin message to the specified user. No message sends the user a page. All messages sent in this manner prefixes the message with [FROM ADMIN]
/ban [<username>] -This bans the specified user from Private Messaging. If the user is invalid or empty the ban menu will be displayed with all valid users to ban. (admins with immunity cannot be banned)
You can disable this feature by commenting out the INVALIDPLAYERMENU define.
/pm -Private Message menu. Same as client version.
<Console Commands>
admin_pm <username> [<message>] -Sends an admin message to the specified user. No message will page the user. All messages sent in this manner prefixes the message with [FROM ADMIN]
pm_ban <username> -Bans the specified user from Private Messaging
<Installation>
Download plugin and lang file (amx_pm.txt)
Put plugin in addons/amxmodx/plugins
Put lang file in /addons/amxmodx/data/lang
Add "amx_pm.amxx" at the end of your plugins.ini file
Change map and you're done.
<Multi-Lingual Support>
Thread available at:
http://forums.alliedmods.net/showthread.php?t=188638
[en] -me
[de] -Mordekay
[hu] -kiki33hun
[bg] -<VeCo>
[fr] -Aooka
[ro] -Razvann
[id] -Randomize
[pt] -
nelsonsimpsonz update: quilhos
[bp] -Phk
[lt] -DoviuX