[SOLVED]Menu problem
Hi.
first : how can i add a space between menu options? like :
PHP Code:
1. hi 2. bye 3. anything
5. lol?
9. exit
2. how can i have a menu in menu?
PHP Code:
1.lol menu 2. haha menu
9. exit
>> by 1 :
ur now in lol menu
1. bluh 2.bluh
9. back
3. i added a menu to my code but when i choose 1, happend nothing.
i just become the say but the code in case 1 has no effect :
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <fakemeta> #include <amxmisc> #include <hamsandwich> #include <fakemeta_const>
#define PLUGIN "Creazy Mazy" #define VERSION "1.0" #define AUTHOR "One"
#define TASK_MENU_DISLPAY_TIME 3.0
new bool:moving[512] = true new const gMovementlevel1[8][1024] = // Dont change 1024!! { "+back;wait;wait;wait;wait-back", "+moveleft;wait;wait;wait;wait;-moveleft", "+moveright;wait;wait;wait;wait;-moveright", "+forward;wait;wait;wait;wait;-forward", "-forward", "-back", "-moveleft", "-moveright" }; new const gMousecmds[6][1024] = { "+lookdown;wait;+right;wait;-right;-lookdown", "+lookup;wait;+left;wait;-lookup;wait;+lookdown;wait;wait;-left;wait;-lookdown", "-lookup", "-lookdown", "-left", "-right" } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd( "CM_Menu","Level_menu") RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1); register_forward( FM_PlayerPreThink, "client_prethink" ) } public Level_menu(id) { new menu = menu_create("\rChoose you´r Level!:", "menu_handler") menu_additem(menu, "\wNormal", "1", 0) menu_additem(menu, "\wMedium", "2", 0) menu_additem(menu, "\whigh", "3", 0) menu_additem(menu, "\whelp", "4", 0) menu_additem(menu, "\wExit", "5", MEXIT_ALL) //menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } public fwHamPlayerSpawnPost(id) { set_task(TASK_MENU_DISLPAY_TIME, "Level_menu", id); return HAM_IGNORED; } public menu_handler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) //return PLUGIN_HANDLED } new data[6], iName[64] new access, callback menu_item_getinfo(menu, item, access, data,5, iName, 63, callback) new key = str_to_num(data) switch(key) { case 1: { if (moving[id]) return PLUGIN_HANDLED; new button = pev(id,pev_button) if (button == IN_FORWARD) { client_cmd(id,"%s", gMovementlevel1[ random_num( 1, charsmax( gMovementlevel1 ) ) ]); } if (button == IN_BACK) { client_cmd(id,"%s", gMovementlevel1[ random_num( 1, charsmax( gMovementlevel1 ) ) ]); } if (button == IN_MOVELEFT) { client_cmd(id,"%s", gMovementlevel1[ random_num( 1, charsmax( gMovementlevel1 ) ) ]); } if (button == IN_MOVERIGHT) { client_cmd(id,"%s", gMovementlevel1[ random_num( 1, charsmax( gMovementlevel1 ) ) ]); } if ( button == IN_RIGHT) { client_cmd(id, "%s", gMousecmds[ random_num( 1, charsmax( gMousecmds ) ) ]); } if ( button == IN_LEFT) { client_cmd(id, "%s", gMousecmds[ random_num( 1, charsmax( gMousecmds ) ) ]); } moving[id] = true; set_task(0.4,"reset",id,"",0,"ab", 1) // Never change this. if change = Channel flood! //set_task(0.4,"reset",id,"",0,"ab", 1) client_print(id, print_chat, "Ok level 1") menu_destroy(menu) //return PLUGIN_HANDLED; } case 2: { client_print(id, print_chat, "22222222") } case 3: { client_print(id, print_chat, "333333!") menu_destroy(menu) //return PLUGIN_HANDLED } } menu_destroy(menu) //return PLUGIN_HANDLED } public reset(id) { moving[id] = false; }
|