Hi, I`m having a little problem with get_concmd.
I registered (let`s say) 11 commands. At my 11th command I made the amx_help for those commands.
PHP Code:
register_concmd("amx_1", "func_1", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_0", "func_0", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_3", "func_3", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_2", "func_2", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_4", "func_4", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_5", "func_5", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_6", "func_6", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_7", "func_7", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_8", "func_8", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_9", "func_9", ADMIN_LEVEL_C, "Some info")
register_concmd("amx_example", "func_help", ADMIN_LEVEL_C, "Some info")
The func_help function is like this:
PHP Code:
public func_help(id, level, cid)
{
new p_Flag = get_user_flags(id, 0)
new cmd[32], eflags, info[128]
new start = 0
new nrofcmds = get_concmdsnum(p_Flag, id)
for(new i=start; i<nrofcmds; i++)
{
get_concmd(i, cmd, 31, eflags, info, 127, p_Flag, id)
client_print(id, print_chat, "Command: %s", cmd)
}
return PLUGIN_HANDLED
}
So basically what the function does is showing all the commands, sorted alphabetically, asc. The only problem is, it is now showing the amx_1 command in the output.
The output is something like this:
Code:
Command: amx_0
Command: amx_2
Command: amx_3
Command: amx_4
Command: amx_5
Command: amx_6
Command: amx_7
Command: amx_8
Command: amx_9
Command: amx_example
I`ve noticed that if I put instead of:
PHP Code:
for(new i=start; i<nrofcmds; i++)
{
get_concmd(i, cmd, 31, eflags, info, 127, p_Flag, id)
client_print(id, print_chat, "Command: %s", cmd)
}
this one
PHP Code:
get_concmd(-5, cmd, 31, eflags, info, 127, p_Flag, id)
client_print(id, print_chat, "Command: %s", cmd)
I can see the amx_1 command.
What should I do to fix this?