OnPlayerSelectedMenuRow not being called
#1

Hello fellow scripters. I have a problem with menus. In the past i have only used dialogs, but i like the look of standard menu's. I'm writing a shop script for the server i script for and have hit a snag. I'm hoping someone can shed light on the matter. Here's the code please tell me if i'm doing something wrong.

pawn Код:
#define AMMO_MENU                           (0)

enum E_SHOP_DATA
{
    Menu:e_mShopMainMenu,
    Menu:e_mShopAmmoMenu,
}

new gShopData[E_SHOP_DATA];

ISHOP::CreateShopMenu()//is called in OnGameModeInit
{
    //main menu
    gShopData[e_mShopMainMenu] = CreateMenu("Shop", 1, 200.0, 100.0, 150.0, 150.0);
   
    AddMenuItem(gShopData[e_mShopMainMenu], 0, "Ammo");
   
   
    //Ammo Menu
   
    gShopData[e_mShopAmmoMenu] = CreateMenu("Ammo", 2, 100.0, 250, 150.0, 150.0);
   
    AddMenuItem(gShopData[e_mShopAmmoMenu], 0, "Armour Piercing");
    AddMenuItem(gShopData[e_mShopAmmoMenu], 1, "$50000");
   
    AddMenuItem(gShopData[e_mShopAmmoMenu], 0, "Hollow Point");
    AddMenuItem(gShopData[e_mShopAmmoMenu], 1, "$50000");
}

public OnPlayerSelectedMenuRow(playerid, row)//never gets executed
{
    new Menu:mPlayerMenu = GetPlayerMenu(playerid);
    printf("ROW: %d", row);//never prints
   
    if(mPlayerMenu == gShopData[e_mShopMainMenu])
    {
        switch(row)
        {
            case AMMO_MENU:
            {
                ShowMenuForPlayer(gShopData[e_mShopAmmoMenu], playerid);
                return 1;
            }
        }
    }
   
    return 1;
}

COMMAND:shop(playerid, params[])
{
    ShowMenuForPlayer(gShopData[e_mShopMainMenu], playerid);
    return 1;
}
Like the title suggests the callback is never called, any idea's why?

2x rep points for the person who helps.

Thanks in advance!
Reply


Messages In This Thread
OnPlayerSelectedMenuRow not being called - by iggy1 - 14.12.2011, 11:27
Re: OnPlayerSelectedMenuRow not being called - by suhrab_mujeeb - 14.12.2011, 12:25
Re: OnPlayerSelectedMenuRow not being called - by wildcookie007 - 14.12.2011, 12:27
Re: OnPlayerSelectedMenuRow not being called - by iggy1 - 14.12.2011, 12:28
Re: OnPlayerSelectedMenuRow not being called - by wildcookie007 - 14.12.2011, 12:30
Re: OnPlayerSelectedMenuRow not being called - by suhrab_mujeeb - 14.12.2011, 12:33
Re: OnPlayerSelectedMenuRow not being called - by iggy1 - 14.12.2011, 12:34
Re: OnPlayerSelectedMenuRow not being called - by wildcookie007 - 14.12.2011, 12:44
Re: OnPlayerSelectedMenuRow not being called - by iggy1 - 14.12.2011, 12:57
Re: OnPlayerSelectedMenuRow not being called - by wildcookie007 - 14.12.2011, 13:01

Forum Jump:


Users browsing this thread: 3 Guest(s)