en-hud is the survival heads-up display. A vitals panel docks to a resized minimap and shows health, armour, stamina, oxygen (underwater), hunger, thirst, radiation, infection, immunity and body temperature. In contextual mode, the default, a stat only appears when it needs attention.
It also shows a compass, street and area names, a vehicle panel (speed, fuel, engine health, seatbelt), a voice indicator for pma-voice, money change pop-ups, XP gains and level-ups, banners when you enter hot or safe zones, a Geiger counter that reacts to radiation, and flashes when survival stats hurt you. Players tune it with /hud and can hide everything with /cinematic. en-hud replaces GTA's cash, vehicle name, area, vehicle class, street name and cash change HUD components.
At a glance
| Depends on | en-core, en-ui |
| Side | Client only |
| Optional | en-inventory (minimap 'item' mode), pma-voice, LegacyFuel or any fuel script using Entity(vehicle).state.fuel, en-zombies (zone banners) |
| Database tables | None. Player settings are saved in client KVP key en-hud:settings |
| Config files | config.lua |
| Key binds | "Open HUD settings" and "Toggle cinematic mode", no default key |
en-hud is safe to restart live: on start it asks en-core IsLoggedIn() and GetMetadata() to rebuild its state.
How it works
- Survival stats come from en-core player metadata:
hunger,thirst,radiation,infection,immunity,temperatureandisdead. Health is normalised from the ped's 100-200 range. See Player data. Config.thresholdsonly decides when a stat shows and when it turns to warning or critical colours. Real damage is set in en-core's server config (Survival system).- XP only shows when you gain it or level up. There is no permanent XP bar.
- Zone banners come from
encore:client:zoneChanged, which en-zombies publishes. The Geiger counter followsencore:client:radiationExposure. - Settings changed in
/hudare saved in client KVP on the player's machine, so they survive server restarts and apply to every character.
The minimap as an earned tool
Config.minimap is a server rule, not a player preference. Set it to 'item' and the radar only shows while the player carries the Config.minimapItem item (default gps), so a working map becomes loot.
Configuration
config.lua:
| Key | Default | What it does |
|---|---|---|
Config.speedUnit | 'mph' | 'mph' or 'kmh' |
Config.minimap | 'always' | 'always', 'vehicle' (only in a vehicle), 'item' (only while carrying minimapItem), 'never' |
Config.minimapItem | 'gps' | Item needed in 'item' mode |
Config.minimapScale | 0.78 | Minimap size relative to GTA's default |
Config.allowBigmap | false | Allow GTA's expanded radar (Z) |
Config.thresholds | see below | When stats show, warn and go critical |
Config.defaults | contextual = true, compass = true, streets = true, vehicle = true, voice = true, money = true, geiger = true, scale = 100 | Initial player settings (scale is clamped to 70-130%) |
Config.fuel(vehicle) | reads Entity(vehicle).state.fuel, then exports.LegacyFuel:GetFuel, then GetVehicleFuelLevel | Override for your fuel script |
Config.voice | enabled = true, ranges = { [1] = 'Whisper', [2] = 'Normal', [3] = 'Shout' } | Voice range labels fallback |
Default thresholds:
| Stat | Values |
|---|---|
| health | warn 40, critical 20 |
| hunger, thirst | show 60, warn 25, critical 10 |
| stamina | show 99 |
| oxygen | warn 50, critical 25 |
| radiation | show 1, warn 150, critical 400, max 1000 |
| infection | show 1, warn 20, critical 60, max 100 |
| immunity | show 70, warn 40, critical 20 |
| temperature | normal 98.6, band 1.5, cold 95.0, hot 104.0, min 90, max 108 |
| fuel | warn 20 |
| engine | warn 40 |
Pointing the fuel gauge at your own fuel script:
-- config.lua
Config.speedUnit = 'kmh'
Config.minimap = 'item'
Config.fuel = function(vehicle)
return exports['my-fuel']:GetFuel(vehicle)
endExports
Client exports on exports['en-hud']:
| Export | Arguments | Returns |
|---|---|---|
SetVisible | visible | Hide or show the HUD from a script |
IsVisible | boolean | |
SetSeatbelt | on | Set the seatbelt indicator |
IsSeatbeltOn | boolean |
Commands
Both are client commands available to every player.
| Command | What it does |
|---|---|
/hud | Open the HUD settings panel |
/cinematic | Toggle cinematic mode, hiding the HUD |
Both have key mappings ("Open HUD settings", "Toggle cinematic mode") with no default key, so players can bind them in Settings > Key Bindings > FiveM.
Events
Events en-hud listens to on the client:
| Event | Payload |
|---|---|
encore:client:playerLoaded / playerUnloaded | |
encore:client:playerDataUpdate | |
encore:client:onSetMetaData | key, value |
encore:client:radiationExposure | rate (drives the Geiger counter) |
encore:client:playerDied / playerRevived | |
encore:client:survivalDamaged | damage, causes |
encore:client:zoneChanged | zone, previous |
encore:client:xpChanged | info |
encore:client:onMoneyChange | moneyType, amount, action, reason |
pma-voice:radioActive |
Seatbelt integration
| Event | Type | What it does |
|---|---|---|
en-hud:client:setSeatbelt | Local client event, boolean | Set the seatbelt indicator |
seatbelt:client:ToggleSeatbelt | Net event | Toggle the indicator (works with qb-smallresources style seatbelt scripts) |
Vehicle classes 8, 13, 14, 15, 16 and 21 have no seatbelt.
State bags
| State | Used for |
|---|---|
LocalPlayer.state.proximity (mode, index) | pma-voice range |
LocalPlayer.state.radioChannel | Radio indicator |
Entity(vehicle).state.fuel | Fuel gauge (first source tried) |
Examples
Hide the HUD during a cutscene and drive the seatbelt icon from your own script:
-- client
exports['en-hud']:SetVisible(false)
-- ... play scene ...
exports['en-hud']:SetVisible(true)
-- a custom seatbelt script
TriggerEvent('en-hud:client:setSeatbelt', true)