1.1 --- a/core/CConCmdManager.cpp Thu Feb 15 22:17:01 2007 +0000
1.2 +++ b/core/CConCmdManager.cpp Fri Feb 16 00:04:14 2007 +0000
1.3 @@ -266,4 +266,56 @@
1.4
1.5 void CConCmdManager::OnRootConsoleCommand(const char *command, unsigned int argcount)
1.6 {
1.7 + if (argcount >= 3)
1.8 + {
1.9 + const char *text = engine->Cmd_Argv(2);
1.10 + int id = atoi(text);
1.11 + CPlugin *pPlugin = g_PluginSys.GetPluginByOrder(id);
1.12 +
1.13 + if (!pPlugin)
1.14 + {
1.15 + g_RootMenu.ConsolePrint("[SM] Plugin index %d not found.", id);
1.16 + return;
1.17 + }
1.18 +
1.19 + CmdList *pList;
1.20 + if (!pPlugin->GetProperty("CommandList", (void **)&pList))
1.21 + {
1.22 + g_RootMenu.ConsolePrint("[SM] No commands found for %s", pPlugin->GetFilename());
1.23 + return;
1.24 + }
1.25 + if (!pList->size())
1.26 + {
1.27 + g_RootMenu.ConsolePrint("[SM] No commands found for %s", pPlugin->GetFilename());
1.28 + return;
1.29 + }
1.30 +
1.31 + CmdList::iterator iter;
1.32 + const char *type = NULL;
1.33 + const char *name;
1.34 + const char *help;
1.35 + g_RootMenu.ConsolePrint(" %-17.16s %-8.7s %s", "[Name]", "[Type]", "[Help]");
1.36 + for (iter=pList->begin();
1.37 + iter!=pList->end();
1.38 + iter++)
1.39 + {
1.40 + PlCmdInfo &cmd = (*iter);
1.41 + if (cmd.type == Cmd_Server)
1.42 + {
1.43 + type = "server";
1.44 + } else if (cmd.type == Cmd_Console) {
1.45 + type = "console";
1.46 + } else if (cmd.type == Cmd_Client) {
1.47 + type = "client";
1.48 + }
1.49 + name = cmd.pInfo->pCmd->GetName();
1.50 + help = cmd.pInfo->pCmd->GetHelpText();
1.51 + g_RootMenu.ConsolePrint(" %-17.16s %-12.11s %s", name, type, help);
1.52 +
1.53 + }
1.54 +
1.55 + return;
1.56 + }
1.57 +
1.58 + g_RootMenu.ConsolePrint("[SM] Usage: sm cmds <plugin #>");
1.59 }
2.1 --- a/core/CConVarManager.cpp Thu Feb 15 22:17:01 2007 +0000
2.2 +++ b/core/CConVarManager.cpp Fri Feb 16 00:04:14 2007 +0000
2.3 @@ -122,7 +122,7 @@
2.4 // If invalid plugin index...
2.5 if (num < 1 || num > (int)g_PluginSys.GetPluginCount())
2.6 {
2.7 - g_RootMenu.ConsolePrint("[SM] Plugin index not found.");
2.8 + g_RootMenu.ConsolePrint("[SM] Plugin index %d not found.", num);
2.9 return;
2.10 }
2.11
2.12 @@ -154,7 +154,7 @@
2.13 }
2.14
2.15 // Display usage of subcommand
2.16 - g_RootMenu.ConsolePrint("[SM] Usage: sm convars <#>");
2.17 + g_RootMenu.ConsolePrint("[SM] Usage: sm convars <plugin #>");
2.18 }
2.19
2.20 Handle_t CConVarManager::CreateConVar(IPluginContext *pContext, const char *name, const char *defaultVal, const char *helpText, int flags, bool hasMin, float min, bool hasMax, float max)