Raised This Month: $51 Target: $400
 12% 

Private Message (Messages history)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-22-2023 , 18:19   Private Message (Messages history)
Reply With Quote #1

  • Description
    Have a private conversation with another player, engage in a private channel and browser older conversations.
  • Modules
    1. nVault - database module
    2. JSON - value of key entry
  • Cvars
    pm_history (default: 35) how many messages to show at once when using /pmread
  • Commands
    <tags> = parameters
    1. say /pm <player> <message> - sends a private message to a player
    2. say /r <message> - quick reply to player you sent a pm unless its your first time getting a pm since you joined the server
    3. say !<message> - quick reply but faster
    4. say /ignore <player> - ignores messages from a person, will stop ignoring if you decide to send a pm to him/her/they/them again
    5. say /sounds - toggle notifications
    6. say /togglepm - toggle pm
    7. say /enter <player> - start a private channel with a player, type the command without specifying a player and it will go to the person you last messaged in a private chat
    8. say /leave - leaves a private channel
    9. say /pmread <number> - read older message
    10. say_team <message> - if you're on a private channel all messages sent here will be viewed only by the recipient
  • Notes
    At the current state it is not possible to delete specific messages.
    Messages sent via PM are permanently saved and cannot be modified.
  • Credits
    Bugsy - bit macros
  • Image



    Messages sorted from newest to oldest
    Supports word-wrap
Attached Files
File Type: zip sounds.zip (64.2 KB, 79 views)
File Type: sma Get Plugin or Get Source (private_message.sma - 52 views - 13.3 KB)
__________________

Last edited by bigdaddy424; 03-09-2024 at 14:47.
bigdaddy424 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-22-2023 , 19:07   Re: Private Message
Reply With Quote #2

Because chat commands can be send relatively fast and most of them won't be relevant to this plugin, I would probably implement a couple optimizations.

The first I would do is to exit the function as soon as you know it's definitely not a relevant message with this after remove_quotes():

PHP Code:
    if( message[0] != '/' && message != '!' )
        return 
PLUGIN_CONTINUE 
Then, while I'm not sure it will actually be significant, you can create variables as static variables so that they don't need to be re-allocated for every chat message.
__________________
fysiks is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-25-2023 , 22:25   Re: Private Message
Reply With Quote #3

Edited*
__________________
bigdaddy424 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-05-2024 , 20:00   Re: Private Message
Reply With Quote #4

Updated the source for viewing pleasure and fixed `for` loop condition.
__________________
bigdaddy424 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-06-2024 , 07:00   Re: Private Message
Reply With Quote #5

Suggestion: A while ago I created a system where you can register messages for admins that are currently offline. As soon as they join back, a notification will alert them that there are messages to be read. Options to answer/delete messages were avaliable too. You can also do something similar in this one.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-06-2024 at 07:01.
EFFx is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-06-2024 , 15:48   Re: Private Message
Reply With Quote #6

That would work great if I had used MySQL or some sort of database.
I have to squeeze a bunch of code to get it working with just nvault.
__________________
bigdaddy424 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-09-2024 , 14:53   Re: Private Message (Messages history)
Reply With Quote #7

I've updated the code once it for all and decided to save every message sent and received from/to another player.
If you wish to change the appearance of the motd window you could so to at line #36
There will not be an option to message offline users or admins, there are plenty of other options such as report systems or even texting admins on other platforms, steam etc.
Consider criticizing/improving and updating the source and leaving feedback. Always up to recommendations to a reasonable extent.
__________________

Last edited by bigdaddy424; 03-09-2024 at 14:56.
bigdaddy424 is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 03-12-2024 , 20:29   Re: Private Message (Messages history)
Reply With Quote #8

Good job for the effort! But I must ask, is there a real need of this plugin nowadays? Because we have a lot of sites or platforms for communication (Discord, whatsapp, FB, VK, telegram, forums), do you think people will use this feature on their servers?

Of course I dont mean to say this is a bad plugin but Im just giving a constructive critic -> for example as EFFx already suggested, to save message for admins...if nvault is a problem - transfer it to mysql? (I know it is easy to say, but you get the point..)

...In case this is just a practicing script/plugin from you, then ignore my reply haha
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-13-2024 , 00:53   Re: Private Message (Messages history)
Reply With Quote #9

thanks
well to be honest ive only used it for chit-chat. im not planning to make this a chat manager with group chats and so on like texting platforms you've mentioned with the only feature being that i received from this is texting my friends about stuff that its not really important to other players and conversations we just continue from other messaging apps around topics we share interest and whatever.
i tried to avoid mysql in particular because it isnt really that important setting up a database just to get a private message plugin running, assuming the majority of people and that including me want this to work right of the bat ever having to worry about config files etc.

i've learnt a few stuff working on this as usual. the amxx web api is simple to understand and every native is explained in detail although i never work on engine or fakemeta and such modules that need more background knowledge of the game. simply because it needs a lot of research and testing
__________________
bigdaddy424 is offline
Reply



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 10:50.


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