CreateMenu
From SA-MP Wiki
Creates a menu
(title[], columns, Float:x, Float:y, Float:col1width, Float:col2width)
| title[] | The title for the new menu. |
| columns | How many colums shall the new menu have |
| Float:x | The position of the menu (0,0) is in upper left |
| Float:y | The position of the menu |
| Float:col1width | The width for the first column |
| Float:col2width | The width for the second column |
| Returns | The ID of the new menu or -1 on failure. |
| Note: This function merely CREATES the menu, you must use ShowMenuForPlayer to show it. |
| Note: If the title's length is equal or greater then 32 chars the title is cut down to the 30 chars. |
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 they're related to this function in one way or another.
- OnPlayerSelectedMenuRow: Called when a player selected a row in a menu.
- OnPlayerExitedMenu: Called when a player exits a menu.
