PHP Code:
public wpnmenu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
//If they are still connected
if( is_user_connected(id) )
//Lets send them back to the top menu
bb_menu(id);
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:
{
wm1_menu(id);
}
case 2:
{
wm2_menu(id);
}
case 3:
{
wm3_menu(id);
}
case 4:
{
wm4_menu(id);
}
case 5:
{
wm5_menu(id);
}
case 7:
{
if(CheckBank(id, 750))
{
giveweapon(id,100)
client_print(id,print_chat,"[OK] You recieved all weapons!")
g_bhealth[id] -= 750
SaveData(id)
}
else if(!CheckBank(id, 750))
{
client_print(id,print_chat,"[OK] You do not have enough blood for this. Cost:750 Have:%d",g_bhealth[id])
}
}
}
menu_destroy(menu);
//Here you might want to show the submenu or the top menu again.
//bb_menu(id);
return PLUGIN_HANDLED;
}
for some reason, when doing this, pressing menu item 7 will just return me to bb_menu, is it counting 7 as exit?
__________________