mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-05-05 11:29:33 +03:00
Add new command to display info about the plugin and add url to amxx plugins command
This commit is contained in:
parent
60aa1cd837
commit
7701c313e0
@ -25,7 +25,7 @@ void amx_command()
|
|||||||
if (!strcmp(cmd, "plugins") || !strcmp(cmd, "list"))
|
if (!strcmp(cmd, "plugins") || !strcmp(cmd, "list"))
|
||||||
{
|
{
|
||||||
print_srvconsole("Currently loaded plugins:\n");
|
print_srvconsole("Currently loaded plugins:\n");
|
||||||
print_srvconsole(" %-23.22s %-11.10s %-17.16s %-16.15s %-9.8s\n", "name", "version", "author", "file", "status");
|
print_srvconsole(" %-3.2s %-23.22s %-11.10s %-17.16s %-32.31s %-12.11s %-9.8s\n", "id", "name", "version", "author", "url", "file", "status");
|
||||||
|
|
||||||
int plugins = 0;
|
int plugins = 0;
|
||||||
int running = 0;
|
int running = 0;
|
||||||
@ -40,7 +40,7 @@ void amx_command()
|
|||||||
if ((*a).isValid() && !(*a).isPaused())
|
if ((*a).isValid() && !(*a).isPaused())
|
||||||
++running;
|
++running;
|
||||||
|
|
||||||
print_srvconsole(" [%3d] %-23.22s %-11.10s %-17.16s %-16.15s %-9.8s\n", plugins, (*a).getTitle(), (*a).getVersion(), (*a).getAuthor(), (*a).getName(), (*a).getStatus());
|
print_srvconsole(" [%3d] %-3i %-23.22s %-11.10s %-17.16s %-32.31s %-12.11s %-9.8s\n", plugins, (*a).getId(), (*a).getTitle(), (*a).getVersion(), (*a).getAuthor(), (*a).getUrl(), (*a).getName(), (*a).getStatus());
|
||||||
}
|
}
|
||||||
++a;
|
++a;
|
||||||
}
|
}
|
||||||
@ -63,6 +63,40 @@ void amx_command()
|
|||||||
|
|
||||||
print_srvconsole("%d plugins, %d running\n", plugins, running);
|
print_srvconsole("%d plugins, %d running\n", plugins, running);
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(cmd, "plugin"))
|
||||||
|
{
|
||||||
|
auto id = atoi(CMD_ARGV(2));
|
||||||
|
|
||||||
|
if (CMD_ARGC() < 3)
|
||||||
|
{
|
||||||
|
print_srvconsole("Usage: amxx plugin < plugin_id >\nFor a list of plugins, use the \"amxx plugins\" command\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto plugin = g_plugins.findPlugin(id);
|
||||||
|
|
||||||
|
if (plugin && plugin->isValid())
|
||||||
|
{
|
||||||
|
print_srvconsole(" Name: %s\n", plugin->getTitle());
|
||||||
|
print_srvconsole(" Version: %s\n", plugin->getVersion());
|
||||||
|
print_srvconsole(" Author: %s\n", plugin->getAuthor());
|
||||||
|
print_srvconsole(" URL: %s\n", plugin->getUrl());
|
||||||
|
|
||||||
|
auto description = plugin->getDescription();
|
||||||
|
if (description[0] != '\0')
|
||||||
|
{
|
||||||
|
print_srvconsole(" Description: %s\n", description);
|
||||||
|
}
|
||||||
|
|
||||||
|
print_srvconsole(" Filename: %s\n", plugin->getName());
|
||||||
|
print_srvconsole(" Status: %s\n", plugin->getStatus());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print_srvconsole("Plugin index %i not found.\n", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (!strcmp(cmd, "pause") && CMD_ARGC() > 2)
|
else if (!strcmp(cmd, "pause") && CMD_ARGC() > 2)
|
||||||
{
|
{
|
||||||
const char* sPlugin = CMD_ARGV(2);
|
const char* sPlugin = CMD_ARGV(2);
|
||||||
@ -244,6 +278,7 @@ void amx_command()
|
|||||||
print_srvconsole(" version - display amxx version info\n");
|
print_srvconsole(" version - display amxx version info\n");
|
||||||
print_srvconsole(" gpl - print the license\n");
|
print_srvconsole(" gpl - print the license\n");
|
||||||
print_srvconsole(" plugins [ criteria ] - list plugins currently loaded or ones matching given search criteria\n");
|
print_srvconsole(" plugins [ criteria ] - list plugins currently loaded or ones matching given search criteria\n");
|
||||||
|
print_srvconsole(" plugin < plugin_id > - information about a plugin\n");
|
||||||
print_srvconsole(" modules - list modules currently loaded\n");
|
print_srvconsole(" modules - list modules currently loaded\n");
|
||||||
print_srvconsole(" cvars [ plugin ] [ index ] - list cvars handled by amxx or show information about a cvar if index is provided\n");
|
print_srvconsole(" cvars [ plugin ] [ index ] - list cvars handled by amxx or show information about a cvar if index is provided\n");
|
||||||
print_srvconsole(" cmds [ plugin ] - list commands registered by plugins\n");
|
print_srvconsole(" cmds [ plugin ] - list commands registered by plugins\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user