CreateMenu

From SA-MP Wiki

Jump to: navigation, search


Creates a menu


Parameters:
(title[], columns, Float:x, Float:y, Float:col1width, Float:col2width)
title[]The title for the new menu.
columnsHow many colums shall the new menu have
Float:xThe position of the menu (0,0) is in upper left
Float:yThe position of the menu
Float:col1width The width for the first column
Float:col2width The width for the second column


ReturnsThe ID of the new menu or -1 on failure.


Image:32px-Circle-style-warning.png Important Note: There is a limit of 12 items per menu, and a limit of 128 menus.


Image:32px-Ambox_warning_orange.png Note: This function merely CREATES the menu, you must use ShowMenuForPlayer to show it.
Image:32px-Ambox_warning_orange.png Note: You can only create and access 2 columns(0,1).
Image:32px-Ambox_warning_orange.png 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.


Related Callbacks

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

Personal tools
In other languages