CreateMenu

From SA-MP Wiki

Jump to: navigation, search


Menu Editors

There is also Menu Editors that may assist with the creation of menus.

Check out Swedky's Menu Creator for an In-Game version.
Check out Jelly23's Menu Creator for an Application version.


Description:

Create 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 X position of the menu (640x460 canvas - 0 would put the menu at the far left).
Float:yThe 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.


Image:32px-Circle-style-warning.png

Important
Note

There is a limit of 12 items per menu, and a limit of 128 menus in total.


Image:32px-Ambox_warning_orange.png

Notes

  • This function merely CREATES the menu - ShowMenuForPlayer must be used to show it.
  • You can only create and access 2 columns (0 & 1).
  • If the title's length is equal to or greater than 32 chars the title is truncated to 30 characters.


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