AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Command Dumper with Flag List (https://forums.alliedmods.net/showthread.php?t=163780)

DarthNinja 08-03-2011 07:35

[Any] Command Dumper with Flag List
 
1 Attachment(s)
[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





DarthNinja 08-03-2011 07:40

Re: [Any] Command Dumper with Flag List
 
Example CSV Output:
(Sorted by command name)

http://content.screencast.com/users/.../CSV_Demo1.png

resin 08-03-2011 15:46

Re: [Any] Command Dumper with Flag List
 
This can be extremely useful for when I add new admin, thank you I'll try it out :)

micazoid 08-04-2011 03:11

Re: [Any] Command Dumper with Flag List
 
Bye Bye sm_help.

Hi there sm_commanddump_use_csv! THX for this!

DarthNinja 08-16-2011 19:45

Re: [Any] Command Dumper with Flag List
 
V1.1.0 Released
I changed the way flags are checked, now the plugin will print all the flags a command registers.

sinblaster 08-16-2011 19:55

Re: [Any] Command Dumper with Flag List
 
this is very cool.

McFlurry 12-07-2011 12:28

Re: [Any] Command Dumper with Flag List
 
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;
}


Silvers 12-07-2011 14:53

Re: [Any] Command Dumper with Flag List
 
Very nice! Any chance you can make another version to dump the game's commands, then how about CVars? :P

minimoney1 01-21-2012 17:24

Re: [Any] Command Dumper with Flag List
 
I have a suggestion:
Maybe you could do like sm_dumpcommands [Admin Flag (e.g. b)] and then it would only dump those commands.

DarthNinja 01-21-2012 18:59

Re: [Any] Command Dumper with Flag List
 
Quote:

Originally Posted by Silvers (Post 1609309)
Very nice! Any chance you can make another version to dump the game's commands, then how about CVars? :P

That's not going to happen since there's not an easy way to loop over game cvars/cmds.

Quote:

Originally Posted by minimoney1 (Post 1636154)
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.


All times are GMT -4. The time now is 20:34.

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