Raised This Month: $47 Target: $400
 11% 

[ANY] SourceMod Plugin Command Info (1.1)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Plugin ID:
3390
Plugin Version:
1.1
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Reports the plugins to which a SourceMod command is registered.
    Old 11-30-2012 , 07:38   [ANY] SourceMod Plugin Command Info (1.1)
    Reply With Quote #1

    SM Command Info

    Version 1.1

    What does it do?
    ----------------------------------------------------
    Does your server have a lot plugins, and you're just not sure where some of your console commands are coming from? Command Info reports the plugins to which a Sourcemod command belongs.

    Example usage
    ----------------------------------------------------
    Code:
    sm_cmdinfo sm_searchcmd
    
    [SM] sm_searchcmd is registered to:
      adminhelp.smx
      adminmenu.smx
      advertisements.smx
    
    sm_cmdinfo sm_slap
    
    [SM] sm_slap is registered to:
      playercommands.smx
    Changelog
    ----------------------------------------------------
    • Version 1.0 (30 November 2012)
      -Initial Version

    • Version 1.1 (30 November 2012)
      -Bug fix: Previously, plugin failed if server had bad plugins or plugins that failed to load.
      -Bug fix: Increased size of command string buffer to be consistent with the hard-coded string size limits.

    Credits
    ----------------------------------------------------
    This plugin was written at the request of Sreaper, based on this inquiry. Thanks to Dr. McKay and Asherkin for providing insight on the code, and everyone else who helped.

    Notes
    ----------------------------------------------------
    -The plugin has a hard-coded limit of 128 plugins, with a maximum of 48 commands per plugin and a maximum command name size of 64 characters. If you want or need more, you'll have to recompile yourself (you know who you are )

    Download
    ----------------------------------------------------
    Attached Files
    File Type: sp Get Plugin or Get Source (sm_cmdinfo.sp - 1515 views - 2.3 KB)
    __________________

    Last edited by Sheepdude; 11-30-2012 at 14:52. Reason: version 1.1
    Sheepdude is offline
    Marcus_Brown001
    AlliedModders Donor
    Join Date: Nov 2012
    Location: Illinois, United States
    Old 11-30-2012 , 07:45   Re: [ANY] SourceMod Plugin Command Info
    Reply With Quote #2

    I like it. It is a really original idea, and I haven't really seen something like it before. However, I can see some needs for this, but not all too many

    Nice work though!
    Marcus_Brown001 is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 11-30-2012 , 10:18   Re: [ANY] SourceMod Plugin Command Info
    Reply With Quote #3

    I think IteratePlugins() might fail if there's only one plugin loaded. It should be like so:

    PHP Code:
    IteratePlugins()
    {
        
    g_PluginCount 0;
        
    h_PluginIterator GetPluginIterator();
        
        if (
    h_PluginIterator != INVALID_HANDLE) {
            do
            {
                new 
    Handle:h_CurrentPlugin ReadPlugin(h_PluginIterator);
                
    GetPluginFilename(h_CurrentPluging_CommandList[g_PluginCount++][0], sizeof(g_CommandList[][]));
                
    CloseHandle(h_CurrentPlugin);
            } while(
    MorePlugins(h_PluginIterator));
            
            
    CloseHandle(h_PluginIterator);
        }

    [edit]

    Or am I mistaken? Looking around it seems like you might be doing it the right way. This will require some testing.

    Last edited by bl4nk; 11-30-2012 at 10:20.
    bl4nk is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 11-30-2012 , 10:52   Re: [ANY] SourceMod Plugin Command Info
    Reply With Quote #4

    better than just
    Code:
    sm cmds 0
    sm cmds 1
    sm cmds 2
    ...
    sm cmds 152 oh here's my plugin!
    Leonardo is offline
    Sheepdude
    SourceMod Donor
    Join Date: Aug 2012
    Location: Chicago
    Old 11-30-2012 , 11:01   Re: [ANY] SourceMod Plugin Command Info
    Reply With Quote #5

    @Leonardo That's the idea. =)
    __________________
    Sheepdude is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 11-30-2012 , 11:31   Re: [ANY] SourceMod Plugin Command Info
    Reply With Quote #6

    Quote:
    Originally Posted by Leonardo View Post
    better than just
    Code:
    sm cmds 0
    sm cmds 1
    sm cmds 2
    ...
    sm cmds 152 oh here's my plugin!
    I'd hope that you'd look up your plugin in the sm plugins list before doing sm cmds.
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    Sheepdude
    SourceMod Donor
    Join Date: Aug 2012
    Location: Chicago
    Old 11-30-2012 , 14:21   Re: [ANY] SourceMod Plugin Command Info (1.1)
    Reply With Quote #7

    Made a slight change, apparently ReadPlugin can return an invalid handle if you have bad plugins installed on your server, so I've added a check for that.
    __________________
    Sheepdude is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Location: Source SDK
    Old 11-30-2012 , 14:28   Re: [ANY] SourceMod Plugin Command Info (1.1)
    Reply With Quote #8

    The plugin works nicely. Thank you.
    __________________

    Last edited by Sreaper; 11-30-2012 at 14:28.
    Sreaper is online now
    Sheepdude
    SourceMod Donor
    Join Date: Aug 2012
    Location: Chicago
    Old 11-30-2012 , 14:53   Re: [ANY] SourceMod Plugin Command Info (1.1)
    Reply With Quote #9

    Whoops I should probably upload the new version along with announcing it. @[email protected]
    __________________
    Sheepdude is offline
    Robin955
    Veteran Member
    Join Date: Jun 2013
    Old 04-30-2017 , 18:54   Re: [ANY] SourceMod Plugin Command Info (1.1)
    Reply With Quote #10

    edit, i just put the plugin on the wrong server. my bad

    Last edited by Robin955; 04-30-2017 at 19:38.
    Robin955 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 20:33.


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