PHP Code:
public JBShopHandlerCT(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 alive = is_user_alive(id)
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(g_packs[id] >= 5 && alive)
{
g_packs[id] -= 5
give_item(id, "weapon_deagle")
}
else
{
client_print(id, print_chat, "[SHOP] You don't have enought points.")
}
menu_display(id, menu, 0)
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
After player takes something from menu i would like that menu would pop-up again untill player press EXIT button.
So the question is do i need to add
PHP Code:
menu_destroy(menu)
at the end of function?