
Initializing
Secure Protocol Active
Was this page helpful?
| Command | Default Key | Description |
|---|---|---|
/openPlayerHud | PAGEDOWN | Toggles the HUD bars on/off. The key can be rebound in the GTA V key settings. |
/hudmenu | (none by default) | Opens the drag-to-position settings editor. Set MBT.EnableHudMenuKey in config.lua to bind a hotkey. |
| Command | Permission | Description |
|---|---|---|
/getDefHudStyle (configurable) | MBT.AllowedRole | Dumps the current element positions as a DefaultStyle table to the server console and copies it to the client clipboard. Paste the output into MBT.Preferences.DefaultStyle in config.lua to update the default layout for all players. |
The admin command name is set via MBT.GetStyleCommand and the required role via MBT.AllowedRole in config.lua.
-- Show or hide the HUD from another resource
exports['mbt_lhud']:showLogoHud(true) -- show
exports['mbt_lhud']:showLogoHud(false) -- hideUseful for hiding the HUD during cutscenes, minigames, or character creation screens in other resources.
SendNUIMessage)action | Additional fields | Description |
|---|---|---|
"handleHUD" | status (boolean) | Show or hide the entire HUD container. |
"toggleBars" | serverID (number) | Toggle bar visibility; also updates the server-ID element. Triggered by /openPlayerHud. |
"sendConfig" | () |
| Callback | Payload | Description |
|---|---|---|
nuiIsReady | — | Fired when the NUI page finishes loading. Triggers Init(): loads scaleform, starts all threads, sends config. |
closeMenuUI | — | Fired when the settings menu closes. Releases NUI focus. |
sendNotify | { text, icon, type } | Fires with the notification data. |
| Event | Description |
|---|---|
mbt_lhud:getDefaultStyle | Triggers getDefaultStyle NUI message on the target player's client. Called by the admin style dump command. |
mbt_lhud:handleHudMenu | Opens the settings panel on the target player's client. Can be triggered from another resource to open the HUD menu remotely. |
| Event | Description |
|---|---|
esx:playerLoaded | Sets playerLoaded = true and shows the HUD on subsequent spawns. |
esx:onPlayerSpawn | Marks first spawn complete. |
esx:onPlayerLogout | Hides HUD and resets playerLoaded. |
| Event | Description |
|---|---|
LocalPlayer.state.isLoggedIn | Polled in a thread; triggers initial hunger/thirst load when true. |
hud:client:UpdateNeeds | (hunger, thirst) — updates hunger and thirst values in real time. |
hud:client:UpdateStress | (stress) — updates stress value (only if ). |
| Event | Description |
|---|---|
pma-voice:setTalkingMode | (rangeIndex) — updates proximity range indicator (1=33%, 2=66%, 3=100%). |
pma-voice:radioActive | (isTalking) — updates talking state on the mic icon. |
| Event | Description |
|---|---|
SaltyChat_TalkStateChanged | (isTalking) — updates talking state. |
SaltyChat_VoiceRangeChanged | (voiceRange, index) — updates range indicator. |
These are the element IDs used in "element" and "setText" NUI messages, and also the keys in MBT.Preferences.DefaultStyle:
| ID | Description |
|---|---|
logo | Server logo image/video |
health | Health bar |
armor | Armor bar |
hunger | Hunger bar |
thirst | Thirst bar |
stress |
payloadMBT.Preferences| Sends the logo, default positions and color config to the NUI on load. |
"updateStatusHud" | health, armor, oxygen, hunger, thirst, stress, inWater | Updates all stat bar values. Sent by stats/status threads. |
"updateWeapon" | status ({ armed, weapon }) | Updates the weapon display (show/hide icon, weapon name). |
"updateMicrophoneStatus" | isTalking, proxRange | Updates the mic icon state and proximity range indicator. |
"element" | task ("enable"|"disable"), value (element ID) | Show or hide a specific HUD element (e.g. "weapon_bullets", "bullets"). |
"setText" | id (element ID), value | Sets the text content of an element (e.g. "weapon_clip", "weapon_ammo"). |
"handleMenuUI" | — | Toggles the drag-to-position settings panel. |
"getDefaultStyle" | — | Tells the NUI to return current positions (triggers clipboard copy). |
setFocus | { status } | Calls SetNuiFocus(status, status) — used by the settings menu to capture/release mouse input. |
UseStress = trueStress bar (hidden unless UseStress = true) |
oxygen | Oxygen bar (sprint stamina or underwater breath) |
microphone | Mic icon + proximity range |
server-id | Player's server ID number |
weapon_bullets | Weapon ammo section container |
bullets | Ammo text container |
weapon_clip | Clip ammo count |
weapon_ammo | Total remaining ammo count |