Raised This Month: $ Target: $400
 0% 

get_concmd problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Salin
Member
Join Date: Nov 2007
Old 02-20-2009 , 09:36   get_concmd problem
Reply With Quote #1

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(idlevelcid)
{
    new 
p_Flag get_user_flags(id0)
    
    new 
cmd[32], eflagsinfo[128]
    
    new 
start 0
    
    
new nrofcmds get_concmdsnum(p_Flagid)
    
    for(new 
i=starti<nrofcmdsi++)
    {
        
get_concmd(icmd31eflagsinfo127p_Flagid)
        
client_print(idprint_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=starti<nrofcmdsi++)
    {
        
get_concmd(icmd31eflagsinfo127p_Flagid)
        
client_print(idprint_chat"Command: %s"cmd)
    } 
this one

PHP Code:
         get_concmd(-5cmd31eflagsinfo127p_Flagid)
         
client_print(idprint_chat"Command: %s"cmd
I can see the amx_1 command.

What should I do to fix this?

Last edited by Salin; 02-20-2009 at 09:41.
Salin is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:02.


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