AddMenuItem
From SA-MP Wiki
(Difference between revisions)
Revision as of 21:45, 6 January 2015 OKStyle (Talk | contribs) ← Previous diff |
Revision as of 17:27, 8 February 2015 Ikkentim (Talk | contribs) Next diff → |
||
Line 8: | Line 8: | ||
{{Param|title[]|The title for the new menu item.}} | {{Param|title[]|The title for the new menu item.}} | ||
- | {{Returns|This function always returns '''0'''.}} | + | {{Returns|The index of the row this item was added to.}} |
{{notes| | {{notes| |
Revision as of 17:27, 8 February 2015
Description:
Adds an item to a specified menu.
(Menu:menuid, column, title[])
menuid | The menu id to add an item to. |
column | The column to add the item to. |
title[] | The title for the new menu item. |
Return Values:
The index of the row this item was added to.
Example Usage:
new Menu:examplemenu; public OnGameModeInit() { examplemenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0); AddMenuItem(examplemenu, 0, "item 1"); AddMenuItem(examplemenu, 0, "item 2"); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- CreateMenu: Create a menu.
- SetMenuColumnHeader: Set the header for one of the columns in a menu.
- DestroyMenu: Destroy a menu.
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.