Skip to Content

Client guide

The HUD runs only on the client. The functions below live in functions.lua.

Hunger, thirst and stress from any script

Without touching functions.lua:

your_script/client.lua
exports.gui_hud:Status("fome", 80) -- "fome" (hunger), "sede" (thirst) or "estresse" (stress), 0 to 100

Hunger and thirst: 100 = full. Stress: 0 = calm.

Or with your own event, inside functions.lua:

functions.lua
RegisterNetEvent("my_status:hunger", function(value) GuiHud.DefinirStatus("fome", value) end)

Fuel

functions.lua
function Gui.Combustivel(veiculo) return exports["my_fuel"]:GetFuel(veiculo) end

Voice

Return 1 = whisper, 2 = normal, 3 = shouting.

functions.lua
function Gui.AlcanceVoz() return exports["my_voip"]:range() end

Seatbelt

First turn off the HUD key: Config.cinto.tecla = nil.

Pick one way.

The HUD asks your script:

functions.lua
function Gui.Cinto() return exports["my_seatbelt"]:IsBuckled() end

Or your script tells the HUD when it changes:

your_script/client.lua
exports.gui_hud:DefinirCinto(true) -- or false

Nitro

Default: the vehicle’s nitro state bag, 0 to 100.

functions.lua
function Gui.Nitro(veiculo) return exports["my_nitro"]:Amount(veiculo) end

Weapon image with ox_inventory

There is a ready block, commented out, inside Gui.ImagemArma. Uncomment it.

Hide the HUD while a menu is open

Edit Gui.PodeMostrar(). Return false while your menu is open:

functions.lua
function Gui.PodeMostrar() if IsPauseMenuActive() then return false end if LocalPlayer.state.menuAberto then return false end -- your menu return true end