Functions

newmenus.inc

amxmodx 1.8.2 hg65

Function Type Description
menu_addblank native Adds a blank line to a menu.
menu_additem native Adds an menu to a menu.
menu_addtext native Adds a text line to a menu. Only available in amxmodx 1.8.1 and above.
menu_cancel native Cancels a player's menu, effectively forcing the player to select MENU_EXIT.
The menu will still exist on their screen but any results are invalidated,
and the callback is invoked.
menu_create native This function has no description.
menu_destroy native Destroys a menu. Player menus will be cancelled (although may still linger
on the HUD), and future attempts to access the menu resource will result in
an error.

This must be called if you create menus dynamically, otherwise you will
leak memory. For normal dynamic menus, you will destroy the menu in the
handler function (remembering to handle the case of a menu being cancelled,
it must still be destroyed).
menu_display native Displays a menu to one client. This should never be called from a handler
when the item is less than 0 (i.e. calling this from a cancelled menu will
result in an error).
menu_find_id native Given a page on a menu and a keypress on that page, returns the item id selected.
If the item is less than 0, a special option was chosen (such as MENU_EXIT).
menu_item_getinfo native Retrieves info about a menu item.
menu_item_setcall native Sets an item's callback.
menu_item_setcmd native Sets an item's info string.
menu_item_setname native Sets an item's display text.
menu_items native Returns the number of items in a menu.
menu_makecallback native Creates a menu item callback handler.

The handler function should be prototyped as:

public <function>(id, menu, item)
id - Client index being displayed to.
menu - Menu resource identifier.
item - Item being drawn.
<return> - ITEM_IGNORE to use the default functionality. ITEM_ENABLED to
explicitly enable or ITEM_DISABLED to explicitly disable.
menu_pages native Returns the number of pages in a menu.
menu_setprop native Sets a menu property.
player_menu_info native Returns information about a menu (if any) the client is currently viewing.

If newmenu is valid, then the menu will refer to the menuid associated with
the title. If newmenu is not valid, and the menu is valid, then the player
is viewing a menu displayed with show_menu().

Both may be invalid if the player is not viewing a menu.