Raised This Month: $ Target: $400
 0% 

What is wrong?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pacheco
Senior Member
Join Date: Jul 2011
Old 09-10-2012 , 18:17   What is wrong?
Reply With Quote #1

PHP Code:
#include <amxmodx>

new szCMD[][] =
{
    
"bb_buildban"// 1
    
"bb_unbuildban"// 2
    
"bb_revive"// 3
    
"bb_guns" // 4
};

new 
szOptions[][] = 
{
    
"Ban"// 1
    
"Unban"// 2
    
"Respawn"// 3
    
"Open Guns Menu" // 4
};

new 
szCommandtempid;

public 
plugin_init()
{
    
register_plugin("[BBXP] ADMIN MENU""1.0""pacheco");

    
register_clcmd("say /menuadm""menu_admin");
    
register_clcmd("say /admin""menu_admin");
}

public 
menu_admin(id)
{
    new 
szMenu menu_create("\y[BBXP] \wMenu Administrador \d(2)" "admin_handler");

    new 
szNum[128];
    
    for(new 
0sizeof(szOptions); i++)
    {
        
num_to_str(1szNum127);
        
menu_additem(szMenuszOptions[i], szNum0);
    }
    
    
menu_display(idszMenu);
}

public 
admin_handler(id)
{
    new 
menu menu_create("\y[BBXP] \wSelect one Player:""menu_handler_go");

          
menu_setprop(menuMPROP_BACKNAME"Back");
    
menu_setprop(menuMPROP_EXITNAME"Exit");
    
menu_setprop(menuMPROP_NEXTNAME"Next");

    new 
players[32], pnum;

    new 
szName[32], szTempid[10];

    
get_players(playerspnum);

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];

        
get_user_name(tempidszNamecharsmax(szName));
        
num_to_str(tempidszTempidcharsmax(szTempid));

        
menu_additem(menuszNameszTempid0);
    }
    
menu_display(idmenu0);
}

public 
menu_handler_go(idszMenuiItem
{
    if(
iItem == MENU_EXIT
        return 
PLUGIN_HANDLED
    
    new 
szData[6], szName[64];
    new 
iAccessiCallBack;
    
menu_item_getinfo(szMenuiItemiAccessszData,5szName63iCallBack);
    
    new 
Key str_to_num(szData);
    
    
szCommand Key;

    new 
szNameT[33];
    
get_user_name(tempidszNameTcharsmax(szNameT));

    
client_cmd(id"%s ^"%s^""szCMD[szCommand], szNameT);
    
client_print(0print_chat"Command: %s"szCMD[szCommand]);
    
    
menu_destroy(szMenu);
    return 
PLUGIN_HANDLED;

When i select the first option in first menu, the command is: bb_unbuildban but i want bb_buildban! What is wrong in the code? Thanks !
__________________




Last edited by pacheco; 09-10-2012 at 19:41.
pacheco 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 08:15.


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