Re: Knife Mod...
try the new menu system, its easier. this should work.
(sorry its not indented. i have to go to school)
PHP Code:
#include <amxmodx> public plugin_init() { //..stuff for your plugin register_clcmd( "say /test","AwesomeMenu") } public AwesomeMenu(id) { new menu = menu_create("\rLook at this awesome Menu!:", "menu_handler") // if there is more than 8 "menu_additem", then a new page optioin wll create its self menu_additem(menu, "\wI'm Selection #1", "1", 0) menu_additem(menu, "\wI'm Selection #2", "2", 0) menu_additem(menu, "\wI'm Selection #3", "3",0) menu_additem(menu, "\wI'm Selection #4", "4", 0) menu_additem(menu, "\wI'm Selection #5", "5", 0) menu_additem(menu, "\wI'm Selection #6", "6", 0) menu_additem(menu, "\wI'm Selection #7", "7", 0) menu_additem(menu, "\wI'm Selection #8", "8", 0) menu_additem(menu, "\wI'm Selection #9", "9", 0) menu_additem(menu, "\wI'm Selection #10", "10", 0) menu_additem(menu, "\wI'm Selection #11", "11", 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[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:{ client_print(id, print_chat, "Hooray! You selected the Awesome 1st Selection") menu_destroy(menu) return PLUGIN_HANDLED } case 2:{ client_print(id, print_chat, "OH NO! You selected the Awesome 2nd Selection! BEWARE!") } case 3:{ client_print(id, print_chat, "You have selected the Awesome 3th Selection! Hail Teh Bail!") menu_destroy(menu) return PLUGIN_HANDLED } case 4:{ client_print(id, print_chat, "OH NO! You selected the Awesome 4th Selection! BEWARE!") } case 5:{ client_print(id, print_chat, "OH NO! You selected the Awesome 5th Selection! BEWARE!") } case 6:{ client_print(id, print_chat, "OH NO! You selected the Awesome 6th Selection! BEWARE!") } case 7:{ client_print(id, print_chat, "OH NO! You selected the Awesome 7th Selection! BEWARE!") } case 8:{ client_print(id, print_chat, "OH NO! You selected the Awesome 8th Selection! BEWARE!") } case 9:{ client_print(id, print_chat, "OH NO! You selected the Awesome 9th Selection! BEWARE!") } case 10:{ client_print(id, print_chat, "OH NO! You selected the Awesome 10th Selection! BEWARE!") } case 11:{ client_print(id, print_chat, "OH NO! You selected the Awesome 11th Selection! BEWARE!") } } menu_destroy(menu) return PLUGIN_HANDLED }
|