Raised This Month: $ Target: $400
 0% 

Private Message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   ALL        Category:   General Purpose       
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-01-2012 , 15:00   Private Message
Reply With Quote #1

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...
Quote:
[PM] <Your Name>: [PAGE]
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
Attached Files
File Type: sma Get Plugin or Get Source (amx_pm.sma - 3223 views - 25.3 KB)
File Type: txt amx_pm.txt (5.2 KB, 1580 views)
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 09-20-2012 at 18:07. Reason: ML update
Liverwiz is offline
 



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 20:32.


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