configs/menu.jsonc owns the menu as a whole: the key and controller button that open it, the tab
it opens on, and the things every tab shares while it is open. Each tab has its own file on top of
this one: the map’s start with map, and the settings screen’s is
Settings. Colours are in
Appearance.
How a configuration file is read and merged is described once, in How configuration works.
Settings
Opening the menu
The label players see for the binding in the FiveM key-mapping menu is the
controls.description
text in the language files. The shipped English
label is Open 3D Pause Menu.
open.key accepts the key names FiveM uses, such as M, F5, TAB or ESCAPE. It is the key a
player gets the first time they join with the menu installed. FiveM then saves it with the player’s
own bindings, so changing this value later reaches only players who have never joined; everyone else
keeps the key they have. ESCAPE is chosen so the menu takes the place of the pause menu. If your
server binds ESCAPE elsewhere, pick another key here.
open.padKey is bound in addition to open.key: the same command answers to both, so a player can
keep a hand on either device. It takes FiveM’s own button names: L1 R1 L2 R2 L3 R3, the
d-pad as LUP LDOWN LLEFT LRIGHT, the face buttons as RUP RDOWN RLEFT RRIGHT
(triangle, cross, square, circle), and SELECT START TOUCH. The binding is always a digital
button, so a trigger cannot be used.
The key-binding page inside the settings screen rebinds keyboard and mouse only, which is the game’s
limit. A player who wants a different controller button changes it in the FiveM console with
bind PAD_DIGITALBUTTON <button> "+<command>". open.padKey, like open.key, sets the button
players get the first time they join.
Start tab
With any tab other than the map, the menu behaves like the game’s own pause menu: Escape at the
top of a page or of the settings closes the whole menu instead of returning to the map.
With
startCamera off, the tab opens at once over the game, blurred behind it, and the camera flies
up only when the player picks the Map tab. With it on, the camera flies up first and the tab is
shown once it has arrived.
A tab that cannot be entered when the key is pressed, such as a page that is not registered or is
disabled, opens the map instead. Another resource can change both settings while the server runs:
see Exports.
Which map
With
"vanilla", the rest of the menu stays: the settings screen and the pages other resources
register work as they do with the 3D map. Only the map changes:
- The Map tab shows the game’s map at full screen, with this menu’s tab bar over it in place of the game’s tabs, so the player can go from the map to the settings or a page and back. The game’s map answers its own controls: zoom, the legend, the waypoint.
- Escape on the map closes the menu.
startTabworks as with the 3D map:"map"opens on the game’s map, and Escape at the top of a page or of the settings goes back to it. Any other tab opens on that tab, and Escape there closes the menu, as a pause menu does.
AddBlip, the postal numbers and custom views belong to the 3D
map and do not appear on the game’s. Blips the game itself knows about do.
Another resource can choose the map per player with SetMapMode: see
Exports.
While the menu is open
Embedded pages
A page another resource registers can host its own interface instead of content the menu draws. Such
a page is loaded inside the menu, so its address is checked: the NUI origin of a resource on this
server (
cfx-nui-<resource>) is always allowed, and anything else has to have its host listed here.
Adding a host you do not control lets that host decide what a player sees inside the menu, so treat
this as a security setting. See Pages.
Example
The game’s own map behind the Map tab:ESCAPE taken by another menu on the server, and the menu opening on the settings:
Applying changes
open.key or open.padKey reaches only players who have never joined with the menu
installed. Everyone else keeps the key they have and can change it in the FiveM key-mapping menu.
Moving every player to a new key takes a new open.command, which also discards the bindings players
chose themselves.