Raised This Month: $ Target: $400
 0% 

[Help] Menu Problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kDiosn
Member
Join Date: Sep 2010
Old 05-08-2011 , 06:51   Re: [Help] Menu Problems
Reply With Quote #10

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;
}
kDiosn is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode