thanks for the reply emp. can u look what i have done wrong, it is still the same problem.
Code:
public WeaponMenu_Handle(iPlayer, menu, item)
{
//Get the menu data
if( item == MENU_EXIT )
{
menu_destroy(menu);
WeaponMenu(iPlayer, menu, item);
return PLUGIN_HANDLED;
}
//Bunc of variables
new data[6], iName[64];
new num[6];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(num);
switch(key)
{
case 1:
{
AwpMenu(iPlayer)
}
case 2:
{
DglMenu(iPlayer)
}
case 3:
{
FsMenu(iPlayer)
}
default:
{
new iGren = str_to_num( data ), iCost, Level;
Level = g_iGrenLevel[iPlayer][iGren] + 1;
iCost = g_iFirstGCost[iGren] * (1 << (Level - 1));
//If player has maxed out the item
if( g_iGrenLevel[iPlayer][iGren] == g_iGrenMaxLevel[iGren] )
{
Print(iPlayer, "^x03You have the max level of %s!", g_iGren[iGren]);
}
//If the player cant afford the item
else if( g_iMoney[iPlayer] < iCost )
{
Print(iPlayer, "^x03You dont have enough Money to buy %s Level: %i", g_iGren[iGren], Level);
}
//Take money, Print and give level
else
{
//Take money
g_iMoney[iPlayer] -= iCost;
//Give a level
g_iGrenLevel[iPlayer][iGren] += 1;
//Print out to the player that he/she bought an item with corresponding level
Print(iPlayer, "^x03You bought %s Level: %i", g_iGren[iGren], Level);
}
}
}
menu_display(iPlayer, menu, 0);
return PLUGIN_HANDLED;
}