hi everybody.this is my first post..
i come from hong kong...my eng is so poor...
Please forgive me


-----------------------------------------
PHP Code:
#define MAX_ITEM_TYPE 3
new const item_name[MAX_ITEM_TYPE][] =
{
a,
b,
c
}
new const item_type[][] =
{
code_a,
code_b,
code_c
}
public code_a(id)
{
user_kill(id)
}
public code_b(id)
{
client_print(id, print_chat, "you're choose the item b")
}
public code_c(id)
{
give_item(id, "weapon_ak47")
}
i want to use menu make it work
like this
PHP Code:
public top_menu(id)
{
new szInfo[60]
new szTempid[32]
formatex(szInfo, 59, "menu")
new menu = menu_create(szInfo , "top_menu2")
for(new i = 0; i < MAX_ITEM_TYPE; i++)
{
new szItems[60]
formatex(szItems, 59, "&s", item_name[i])
num_to_str(i, szTempid, 31)
menu_additem(menu, szItems, szTempid, 0)
}
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public top_menu2(id , menu , item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new i = str_to_num(data)
item_type[id][i] //<------here..=_=
menu_destroy(menu)
return PLUGIN_HANDLED
}
But it is sure not work
who can help me and make it work
thank you