|
Author
|
Message
|
|
Junior Member
|

11-04-2011
, 10:31
bug in the menu..
|
#1
|
Have a bug in the menu If I choose the first option is no do Nothing and if i choose the option 2 is do the first option
pliz fix this ..
PHP Code:
#include <amxmodx>
new const MENU_NAMES[][] = { "Molotov", "Other Item", "Other Item2" }
new const COMMANDS[sizeof MENU_NAMES][] = { "say /molotov", "othercmd", "othercmd2" }
public plugin_init() { register_plugin( "Menu Commands", "1.0", "Wrecked" ) // :avast: register_clcmd( "say /shop", "CMD_Shop" ) register_clcmd( "say_team /shop", "CMD_Shop" ) }
public CMD_Shop( id ) { new menu = menu_create( "Choose Your Item:", "MENU_Handler" ) new szItem[10] for( new i = 0; i < sizeof MENU_NAMES; i++ ) { formatex( szItem, 9, "%d", i ) menu_additem( menu, MENU_NAMES[i], szItem, 0 ) } menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ) menu_display( id, menu, 0 ) }
public MENU_Handler( id, menu, item ) { if( item == MENU_EXIT ) { menu_destroy( menu ) return PLUGIN_HANDLED; } new data[10] new access new callback menu_item_getinfo( menu, item, access, data, 9, _, _, callback ) client_cmd( id, COMMANDS[str_to_num( data )-1] ) menu_destroy( menu ) return PLUGIN_HANDLED; }
|
|
|
|