A very interesting thing. Invoking the plugin is once per round and only one player! How can this be?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "HoLLyWooD"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "buy","clcmd_buy");
}
public clcmd_buy(id){
menu_go(id)
log_amx("%d call menu!",id);
}
menu_go(id){
if(!is_user_alive(id))
return PLUGIN_HANDLED;
AwesomeMenu(id);
return PLUGIN_CONTINUE;
}
public AwesomeMenu(id){
new menu = menu_create("\rLook at this awesome Menu!:", "menu_handler");
menu_additem(menu, "\wI'm Selection #1", "1", 0);
menu_additem(menu, "\wI'm Selection #2", "2", 0);
menu_additem(menu, "\wI'm Secret Selection #3", "3", ADMIN_ADMIN);
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 Admin Selection! Hail Teh Bail!");
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
Who can help - that cake
menu get from
http://forums.alliedmods.net/showthr...6364#BasicMenu
__________________