An example:
PHP Code:
show_menu_extras(id)
{
if (!is_user_alive(id))
return;
static menuid, menu[128], team, buffer[32]
formatex(menu, charsmax(menu), "Items Menu")
menuid = menu_create(menu, "menu_extras")
for (new i = 0; i < g_extraitem_i; i++)
{
formatex(menu, charsmax(menu), "%s \r[Cost: %d]", buffer, ArrayGetCell(g_extraitem_cost, i))
buffer[0] = i
buffer[1] = 0
menu_additem(menuid, menu, buffer)
}
if (menu_items(menuid) <= 0)
{
client_print(id, print_chat, "No items in menu")
menu_destroy(menuid)
return;
}
// Back - Next - Exit
menu_setprop(menuid, MPROP_BACKNAME, "Back page")
menu_setprop(menuid, MPROP_NEXTNAME, "Next page")
menu_setprop(menuid, MPROP_EXITNAME, "Exit menu")
// If remembered page is greater than number of pages, clamp down the value
MENU_PAGE_EXTRAS = min(MENU_PAGE_EXTRAS, menu_pages(menuid)-1)
// Fix for AMXX custom menus
if (pev_valid(id) == PDATA_SAFE)
set_pdata_int(id, OFFSET_CSMENUCODE, 0, OFFSET_LINUX)
menu_display(id, menuid, MENU_PAGE_EXTRAS)
}
This plugin what the zombie_plague40 kick and I need to know how to sort the items by price ...
PS: These items are added with a native ...
Example:
zp_register_extra_item ("Super Gun", 30, ZP_TEAM_HUMAN)