HUD
Player, vehicle, minimap and info HUD with a per-player settings menu.
Dependencies
ox_liboxmysql- Qbox, QB-Core or ESX. Without a framework the HUD still runs, but money, job and needs show defaults.
ensure gig-hudItems
Both items are optional. Leave the config key at false if you do not want them.
| Item | Used by | Config key |
|---|---|---|
harness | racing harness, keeps you in the seat above the belt speed limit | cfg.harness.itemName |
nitrous | refills the nitro tank, consumed on use | cfg.nitro.refillItem |
The harness is checked, never consumed. Add both to your inventory as usable items:
['harness'] = {
label = 'Racing Harness',
weight = 1000,
stack = false,
close = true,
},
['nitrous'] = {
label = 'Nitrous',
weight = 2000,
stack = true,
close = true,
},['harness'] = { name = 'harness', label = 'Racing Harness', weight = 1000, type = 'item', image = 'harness.png', unique = true, useable = true, shouldClose = true, description = 'Keeps you in the seat.' },
['nitrous'] = { name = 'nitrous', label = 'Nitrous', weight = 2000, type = 'item', image = 'nitrous.png', unique = false, useable = true, shouldClose = true, description = 'Refills the nitro tank.' },Commands and keys
| Command | Default key | What it does |
|---|---|---|
/hud | F7 | opens the settings menu |
/cinematic | F10 | toggles letterbox bars |
/seatbelt | K | buckle / unbuckle |
/cruise [kmh] | L | speed limiter |
/harness | none | equip / remove the harness |
/anchor | X | drop / raise the boat anchor |
| nitro | left Alt (hold) | boost |
Keys are defaults. Players change them in the GTA keybind settings under FiveM.
Config
cfg.lua is long because the HUD has a lot of switches. The parts worth knowing:
cfg.serverNameandcfg.logofill the info panel. The logo accepts annui://path or an https URL.cfg.defaultsholds the default value of every menu option. Sethide = trueon a category to remove its tab and switch that part of the HUD off for everyone, or on a single option to force its value and remove the row. Forced values win over whatever a player saved earlier. Players override the rest from the menu and their choices are saved per character.cfg.seatbelt.providerisbuiltinby default: the HUD's own belt, usable from any seat. Set it toexternalwhen another script handles seatbelts; that script either setsLocalPlayer.state.seatbelt(the key iscfg.seatbelt.stateKey) or calls thesetSeatbeltexport, and the HUD icon, the crash ejection and the harness logic follow it.cfg.ejectthrows unbuckled players through the windscreen on a hard crash.cfg.stressEffectblurs the screen at stress thresholds.cfg.nitrois a complete example nitro system. Turn it off if you use another one; the nitro gauge still works through the export below.cfg.electricVehicleslists models that show a battery instead of fuel.cfg.radarlocks the minimap zoom and disables the big map.
Exports
Client side:
exports['gig-hud']:toggleHud(state) -- show or hide the whole HUD
exports['gig-hud']:setCinematic(state)
exports['gig-hud']:setSeatbelt(state) -- also getSeatbelt(), setHarness(), getHarness()
exports['gig-hud']:setStatusCell(id, value) -- update a custom status cell (see cfg.customCells)
exports['gig-hud']:setVehicleCell(id, value)
exports['gig-hud']:setInfoCell(id, text, label)
exports['gig-hud']:set3DGpsState(state) -- 3D GPS route on/offServer side:
exports['gig-hud']:getSettings(src) -- the player's saved settings tableNotes
- The nitro gauge reads a state bag. If you use an external nitro script, write
Entity(vehicle).state.nitro(0 to 100) and the gauge follows. - Odometer support for
jg-vehiclemileageis behindcfg.jgMileage. - The voice indicator detects pma-voice and SaltyChat. Force one with
cfg.voiceProviderif detection picks the wrong one.
GIG Scripts