OnPlayerSelectedMenuRow

From SA-MP Wiki

Jump to: navigation, search

OnPlayerSelectedMenuRow


This callback is called when a player selects an item from a menu.


Parameters:
(playerid, row)
playeridID of the player who selected the menu item.
rowThe row that was selected.


new Menu:menu;
menu = CreateMenu("Example Menu", 1, 50.0, 180.0, 200.0, 200.0);
AddMenuItem(menu, 0, "Item 1");
AddMenuItem(menu, 0, "Item 2");
public OnPlayerSelectedMenuRow(playerid, row)
{
    new Menu:current;
    current = GetPlayerMenu(playerid);
    if(current == menu)
    {
        switch(row)
        {
            case 0: print("Item 1");
            case 1: print("Item 2");
        }
    }
    return 1;
}

Related Callbacks

The following callbacks might be useful as well, as they're related to this callback in one way or another.


Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

Personal tools