Raised This Month: $182 Target: $400
 45% 

[Any] Command Dumper with Flag List


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
2475
Plugin Version:
1.1.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    52 
    Plugin Description:
    Lists all commands created by SM along with their info including required admin flags.
    Old 08-03-2011 , 07:35   [Any] Command Dumper with Flag List
    Reply With Quote #1

    [Any] Command Dumper
    TF2 Version 1.1.0



    Description:
    This plugin will create a file (plaintext or .csv) with all SM-created commands, along with their descriptions and required admin flags.
    For more info, see Notes.

    Commands:
    • sm_dumpcommands
      • Dumps all commands to a file.

    Cvars:
    • sm_commanddump_version
      • Plugin Version
    • sm_commanddump_use_csv
      • 0 = The plugin will output to a .txt file (default).
      • 1 = The plugin will output to a .csv file. Useful for importing into excel/google docs/etc so you can sort commands by flag, etc.

    Install Instructions:

    1. Place CommandDump.smx into your addons/sourcemod/plugins/ folder.

    Notes:
    • The plugin will tell you the location of the output file when you run the command.
    • The plugin is only able to detect adminflags that are registered when the command is registered.
      Plugins that use CheckCommandAccess or equivalent in the callback will be reported as "No flag registered".
    • The plugin will report flags as they appear on the server. A slay command that is overridden to ban will be detected as "ADMFLAG_BAN".

    Version History:
    • V1.0.0
      • Initial Release
    • V1.0.1
      • No longer loads common.phrases as doing so is not required.
    • V1.1.0
      • Now handles commands that use multiply flags properly.

    Total downloads as prior to last edit: 43




    Attached Files
    File Type: sp Get Plugin or Get Source (CommandDump.sp - 1203 views - 4.3 KB)
    __________________

    Last edited by DarthNinja; 08-16-2011 at 19:37.
    DarthNinja is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 08-03-2011 , 07:40   Re: [Any] Command Dumper with Flag List
    Reply With Quote #2

    Example CSV Output:
    (Sorted by command name)


    __________________

    Last edited by DarthNinja; 08-04-2011 at 04:19.
    DarthNinja is offline
    resin
    Member
    Join Date: Dec 2008
    Location: Valve's Underbelly
    Old 08-03-2011 , 15:46   Re: [Any] Command Dumper with Flag List
    Reply With Quote #3

    This can be extremely useful for when I add new admin, thank you I'll try it out
    resin is offline
    micazoid
    Veteran Member
    Join Date: Oct 2010
    Location: Munich - Germany
    Old 08-04-2011 , 03:11   Re: [Any] Command Dumper with Flag List
    Reply With Quote #4

    Bye Bye sm_help.

    Hi there sm_commanddump_use_csv! THX for this!
    __________________
    micazoid is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 08-16-2011 , 19:45   Re: [Any] Command Dumper with Flag List
    Reply With Quote #5

    V1.1.0 Released
    I changed the way flags are checked, now the plugin will print all the flags a command registers.
    __________________
    DarthNinja is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 08-16-2011 , 19:55   Re: [Any] Command Dumper with Flag List
    Reply With Quote #6

    this is very cool.
    __________________
    Happy Happy Joy Joy

    sinblaster is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 12-07-2011 , 12:28   Re: [Any] Command Dumper with Flag List
    Reply With Quote #7

    Is this code any better?
    Code:
            for(new bit=1;bit<=ADMFLAG_CUSTOM6;bit*=2)
            {
                if(iFlags == 0)
                {
                    Format(strFlags, sizeof(strFlags), "No flag registered");
                    break;
                }    
                else if(iFlags & bit)
                {
                    new cbit = GetLeftBitShifts(bit);
                    StrCat(strFlags, sizeof(strFlags), strFlagNames[cbit]);
                }
            }
    strFlagNames
    Code:
    new String:strFlagNames[][] =
    {
        "ADMFLAG_RESERVATION ",
        "ADMFLAG_GENERIC ",
        "ADMFLAG_KICK ",
        "ADMFLAG_BAN ",
        "ADMFLAG_UNBAN ",
        "ADMFLAG_SLAY ",
        "ADMFLAG_CHANGEMAP ",
        "ADMFLAG_CONVARS ",
        "ADMFLAG_CONFIG ",
        "ADMFLAG_CHAT ",
        "ADMFLAG_VOTE ",
        "ADMFLAG_PASSWORD ",
        "ADMFLAG_RCON ",
        "ADMFLAG_CHEATS ",
        "ADMFLAG_ROOT ",
        "ADMFLAG_CUSTOM1 ",
        "ADMFLAG_CUSTOM2 ",
        "ADMFLAG_CUSTOM3 ",
        "ADMFLAG_CUSTOM4 ",
        "ADMFLAG_CUSTOM5 ",
        "ADMFLAG_CUSTOM6 "
    };
    Stock:
    Code:
    stock GetLeftBitShifts(bit)
    {
        new compressed;
        while(bit > 1)
        {
            bit /= 2;
            compressed++;
        }
        return compressed;
    }
    __________________

    Last edited by McFlurry; 12-07-2011 at 13:16.
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: Space
    Old 12-07-2011 , 14:53   Re: [Any] Command Dumper with Flag List
    Reply With Quote #8

    Very nice! Any chance you can make another version to dump the game's commands, then how about CVars?
    __________________
    Silvers is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 01-21-2012 , 17:24   Re: [Any] Command Dumper with Flag List
    Reply With Quote #9

    I have a suggestion:
    Maybe you could do like sm_dumpcommands [Admin Flag (e.g. b)] and then it would only dump those commands.
    minimoney1 is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 01-21-2012 , 18:59   Re: [Any] Command Dumper with Flag List
    Reply With Quote #10

    Quote:
    Originally Posted by Silvers View Post
    Very nice! Any chance you can make another version to dump the game's commands, then how about CVars?
    That's not going to happen since there's not an easy way to loop over game cvars/cmds.

    Quote:
    Originally Posted by minimoney1 View Post
    I have a suggestion:
    Maybe you could do like sm_dumpcommands [Admin Flag (e.g. b)] and then it would only dump those commands.
    You can just sort/filter the commands in excel.
    __________________
    DarthNinja 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:53.


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