Try this. Its a snippet of what works on our server. It also adds a check to ensure the bot value is
within a specific range (edit for you needs) and reports the change in chat. Requires admin level 'f'.
Code:
#include <amxmodx>
#define PLUGIN "AMX Bot Control"
#define VERSION "1.0"
#define AUTHOR "Vet(3TT3V)"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_bot_max", "BotCon", ADMIN_MAP)
}
public BotCon(id, lvl, cid)
{
if (!cmd_access(id, lvl, cid, 2))
return PLUGIN_HANDLED
new arg[8]
new tmpint
read_argv(1, arg, 7)
tmpint = str_to_num(arg)
if (tmpint < 1 || tmpint > 19) {
console_print(id, "Number out of range (1 - 19)")
return PLUGIN_HANDLED
}
new tmpstr[32]
format(tmpstr, 31, "bot ^"max_bots %d^"", tmpint)
server_cmd(tmpstr)
console_print(id, "max_bots set to %d", tmpint)
get_user_name(id, tmpstr, 31)
log_message("[AMXX] Admin %s set max_bots to %d", tmpstr, tmpint)
if (get_cvar_num("amx_show_activity") == 2)
client_print(0, print_chat, "ADMIN %s: set max_bots to %d", tmpstr, tmpint)
return PLUGIN_HANDLED
}
FYI, per the Foxbot instructions I've read, the prefix is NOT surrounded by quotes.
An example RCON command would be:
RCON bot "max_bots 10"
__________________