Raised This Month: $ Target: $400
 0% 

[ANY] Private Trigger Log (1.2) [10-May-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6070
Plugin Version:
1.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    Suppresses text said after a slash and displays to admins. Logs all attempted private trigger commands.
    Old 04-01-2018 , 15:55   [ANY] Private Trigger Log (1.2) [10-May-2020]
    Reply With Quote #1

    CVars:

    Saved to private_trigger.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // Admins must have these flags to be shown the private triggered commands.
    private_trigger_admin_flag "z"

    // 0=Hide successful commands (Sourcemod default), 1=Hide all messages.
    private_trigger_chat_block "1"

    // 0=Disables, 1=Enables logging of each private trigger attempt.
    private_trigger_log "1"

    // Private Trigger Log plugin version.
    private_trigger_version 


    Changes:
    Code:
    1.2 (10-May-2020)
        - Various changes to tidy up code.
        - Various optimizations and fixes.
    
    1.1 (05-May-2018)
        - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
        - Replaced AddCommandListener with OnClientSayCommand.
    
    1.0 (01-Apr-2018)
        - Initial release.


    Installation:
    • Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.

      Logs are saved in your servers \sourcemod\logs\ folder. SourceMods default actions log file.
    Attached Files
    File Type: sp Get Plugin or Get Source (private_trigger.sp - 673 views - 5.5 KB)
    __________________

    Last edited by Silvers; 05-10-2020 at 07:15.
    Silvers is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 04-01-2018 , 17:55   Re: [ANY] Private Trigger Log
    Reply With Quote #2

    Sourcemod's core.cfg configuration includes options on what characters are public chat triggers ( ! by default), silent triggers ( / by default ), and whether or not to hide typo'd commands that used the silent trigger. This functionality already exists in Sourcemod without a custom plugin.

    It should be possible to have your plugin determine what these characters are for the purposes of displaying and logging command uses. Not all servers use /

    Also, you shouldn't be using FCVAR_REPLICATED on your version cvar, as the version cvar doesn't exist on the client. And all FCVAR_NOTIFY does is print a message to players in the chat when the cvar value changes.
    __________________

    Last edited by ddhoward; 04-01-2018 at 18:06.
    ddhoward is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 04-01-2018 , 20:36   Re: [ANY] Private Trigger Log
    Reply With Quote #3

    Oh that's a good point. How would I go about detecting which trigger is being used for private triggers?

    With regards to the cvar flags, some were required or something in the sourcemod documentation which I have stuck to ever since I started writing plugins, I don't know what I should use, nor do I really care, but for the sake of keeping everything standard I would actually like to know, there just doesn't seem to be a recommended standard.
    __________________

    Last edited by Silvers; 04-01-2018 at 20:37.
    Silvers is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 04-05-2018 , 06:42   Re: [ANY] Private Trigger Log
    Reply With Quote #4

    This plugin could probably be rewritten to control who is allowed to use private triggers. (No such feature exists in SM).

    If a player doesn't have the right flag to use a silent trigger, resend the say text as a public trigger instead of printing to admins.

    OnClientSayCommand has replaced addcommandlisteners, btw.

    Edit: sourcemod has no function to decide what is a private or public trigger. The boolean doesn't take that into acount, WTF?
    And for flags, only use FCVAR_NOTIFY for the version cvar. You don't need any flags for the plugin specific settings.

    Last edited by Visual77; 04-06-2018 at 05:12.
    Visual77 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 04:24.


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