Raised This Month: $7 Target: $400
 1% 

Private Message


Post New Thread Reply   
 
Thread Tools Display Modes
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 - 3204 views - 25.3 KB)
File Type: txt amx_pm.txt (5.2 KB, 1562 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
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-01-2012 , 15:24   Re: Private Message
Reply With Quote #2

Reserved
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 08-12-2012 at 20:43.
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-01-2012 , 15:46   Re: Private Message
Reply With Quote #3

Quote:
Originally Posted by Liverwiz View Post
Fast and easy to use, you simply put a backslash before the person's name who you want to message
"\" is a backslash. "/" is a slash. FYI.

Quote:
Originally Posted by Liverwiz View Post
<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.
This seems counterintuitive to me.

Also, you check the same cvar twice in both commands (if it goes through). Personally, for a cvar like this, I would cache it at plugin_cfg() or something.
__________________
fysiks is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-01-2012 , 20:52   Re: Private Message
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
"\" is a backslash. "/" is a slash. FYI.
I always got those two confused.....
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-02-2012 , 08:30   Re: Private Message
Reply With Quote #5

I think this is already made?
Not sure..
__________________
Retired.
Xalus is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-02-2012 , 08:33   Re: Private Message
Reply With Quote #6

Quote:
Originally Posted by Xalus View Post
I think this is already made?
Not sure..
I thought the same thing, but I couldn't locate the plugin. Then again, I didn't search that long to try and find it.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-02-2012 , 08:56   Re: Private Message
Reply With Quote #7

@Xalus and YamiKaitou

Maybe you guys are thinking of this or this.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-02-2012 , 10:14   Re: Private Message
Reply With Quote #8

Quote:
Originally Posted by wickedd View Post
@Xalus and YamiKaitou

Maybe you guys are thinking of this or this.
I saw one PM mod before, but it didn't do what this one does. And, as usual, right AFTER i released this an idea came to me to make this one original (that i don't think others have) so give me a little bit before unapproving because of redundancy. Also, if anyone else has some ideas for it please let me know. This has much room to grow.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-02-2012 , 10:19   Re: Private Message
Reply With Quote #9

Quote:
Originally Posted by wickedd View Post
@Xalus and YamiKaitou

Maybe you guys are thinking of this or this.
No, the one I am thinking of used nVault. I don't think it was identical but I wanted to compare. As far as I know, I am not aware of a similar one to this one, unless you count the base plugin functionality.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-02-2012 , 18:50   Re: Private Message
Reply With Quote #10

I made one before but Hawk552 didn't like it even though it was unique.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 05:47.


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