CreateMenu
Description:
Function CreateMenu creates a menu.
|
There is a limit of 12 items per menu, and a limit of 128 menus in total. |
Parameters:
(title[], columns, Float:x, Float:y, Float:col1width, Float:col2width)
int | title | The title for the new menu. |
string | columns | How many colums shall the new menu have. |
float | X | The X position of the menu (640x460 canvas - 0 would put the menu at the far left). |
float | Y | The Y position of the menu (640x460 canvas - 0 would put the menu at the far top). |
float | col1width | The width for the first column. |
float | col2width | The width for the second column. |
Return Values:
The ID of the new menu or -1 on failure.
Examples:
new Menu:examplemenu; public OnGameModeInit() { examplemenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- AddMenuItem: Add an item to a menu.
- SetMenuColumnHeader: Set the header for one of the columns in a menu.
- DestroyMenu: Destroy a menu.
- ShowMenuForPlayer: Show a menu for a player.
- HideMenuForPlayer: Hide a menu for a player.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerSelectedMenuRow: Called when a player selected a row in a menu.
- OnPlayerExitedMenu: Called when a player exits a menu.