Troubleshooting

Solutions for the most common problems with More Menus.

Common problems and how to resolve them. If a menu misbehaves, look at the F8 console first: the resource prints errors with the prefix [MORE Scripts - Menus].

Check that more_lib is started before more_menus and that the folder is called more_menus. Call the export on the client, not on the server. If Open was given a wrong argument, it prints an error beginning with [MORE Scripts - Menus] Error to the F8 console and returns nil: the type must be default, dialog or list, the namespace and name must be strings, and data must be a table whose lists (elements, head, rows, info, summary) contain only tables.

A default menu without rows shows the text Nothing to choose here. Make sure data.elements is a list of tables, each with at least a label. A list without rows shows Nothing to show; check that every row is a table with a cols table.

Backspace in a default menu, the Cancel button of a dialog and the close button of a list only run your cancel callback. They do not close the menu by themselves. Pass a cancel function to Open and call menu.close() inside it, or Close with the type, namespace and name.

Close the menu with menu.close(), Close or CloseAll. Menus opened by a resource that stops are removed automatically, without their callbacks. The cursor and the mouse capture are released as soon as no dialog, list or mouse mode is open anymore. Menus also close, with their close callbacks, when the player dies.

The arrow keys, Enter and Backspace only work for the newest default menu, not while the pause menu is open and not while a dialog, a list or mouse mode has the mouse (in mouse mode the keyboard of the page still works). Check the bindings in the FiveM key settings, where they are listed as Menu: up, Menu: down and so on, and make sure no other script uses the same key.

MS.Keys only sets the default key. A player's own binding in the FiveM key settings wins, so players who already changed or saved a binding keep their old key. They can change it themselves in the key settings.

Mouse mode is turned on with left Alt (MS.Keys cursor) and only works while a default menu is open and the pause menu is closed. Alt again or a right click leaves it. If another script or voice chat uses left Alt, change the key in the key settings.

On Confirm the text is checked. Text that reads as a number is rounded to a whole number and refused when it is below min or above max, and min is 1 when you do not set one. So 0 and negative numbers are refused unless you set min to 0 or lower. A number that is not finite is refused too. The same applies to a text dialog when the player types a number.

Confirm is blocked while an error line is shown. Call SetDialogError with the namespace and name of the dialog and nil as text to clear it, for example in the change callback when the input is fine again. The line also disappears when you open the dialog again without an error field.

setTitle, setElement, setElements, update and removeElement only change the menu. Call menu.refresh() afterwards to show the result. Work on the menu you received, not on a copy you made yourself: values you write to menu.data of a returned menu do not reach the open menu.

Every text of the menus is converted to plain text and HTML tags are removed, so a coloured span from an old ESX menu shows only its text. Use the icon, rightLabel and tone fields instead.

A button must be written as {{Label|value}} inside the text of a cell and your script needs a submit callback, which receives the row data and the value of the button. A value that is a plain number arrives as a number, everything else as text. Strip {{ and }} from texts that players wrote so that they cannot plant buttons.

The search bar appears automatically from 9 rows on. Set search = true in the list data to show it with fewer rows, or false to hide it.

The shorthands cash, bank and black read the money through more_lib, which reads it from your framework, and they update when more_lib reports a money change. Check that more_lib is running and that your framework has that kind of money (black money is not available everywhere). As an alternative, put your own entry in the info list with the label, value and money fields.

The command is only registered while dev_mode in cl_config.lua is true. Set it, restart the resource and type /testmenu. Turn dev_mode off again on a live server.

Last updated