EndCore Framework

en-hud

The survival HUD with vitals, compass, streets, vehicle panel, voice, money and XP pop-ups, zone banners and a Geiger counter.

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 onen-core, en-ui
SideClient only
Optionalen-inventory (minimap 'item' mode), pma-voice, LegacyFuel or any fuel script using Entity(vehicle).state.fuel, en-zombies (zone banners)
Database tablesNone. Player settings are saved in client KVP key en-hud:settings
Config filesconfig.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, temperature and isdead. Health is normalised from the ped's 100-200 range. See Player data.
  • Config.thresholds only 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 follows encore:client:radiationExposure.
  • Settings changed in /hud are 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:

KeyDefaultWhat 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.minimapScale0.78Minimap size relative to GTA's default
Config.allowBigmapfalseAllow GTA's expanded radar (Z)
Config.thresholdssee belowWhen stats show, warn and go critical
Config.defaultscontextual = true, compass = true, streets = true, vehicle = true, voice = true, money = true, geiger = true, scale = 100Initial player settings (scale is clamped to 70-130%)
Config.fuel(vehicle)reads Entity(vehicle).state.fuel, then exports.LegacyFuel:GetFuel, then GetVehicleFuelLevelOverride for your fuel script
Config.voiceenabled = true, ranges = { [1] = 'Whisper', [2] = 'Normal', [3] = 'Shout' }Voice range labels fallback

Default thresholds:

StatValues
healthwarn 40, critical 20
hunger, thirstshow 60, warn 25, critical 10
staminashow 99
oxygenwarn 50, critical 25
radiationshow 1, warn 150, critical 400, max 1000
infectionshow 1, warn 20, critical 60, max 100
immunityshow 70, warn 40, critical 20
temperaturenormal 98.6, band 1.5, cold 95.0, hot 104.0, min 90, max 108
fuelwarn 20
enginewarn 40

Pointing the fuel gauge at your own fuel script:

lua
-- config.lua
Config.speedUnit = 'kmh'
Config.minimap = 'item'

Config.fuel = function(vehicle)
    return exports['my-fuel']:GetFuel(vehicle)
end

Exports

Client exports on exports['en-hud']:

ExportArgumentsReturns
SetVisiblevisibleHide or show the HUD from a script
IsVisibleboolean
SetSeatbeltonSet the seatbelt indicator
IsSeatbeltOnboolean

Commands

Both are client commands available to every player.

CommandWhat it does
/hudOpen the HUD settings panel
/cinematicToggle 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:

EventPayload
encore:client:playerLoaded / playerUnloaded
encore:client:playerDataUpdate
encore:client:onSetMetaDatakey, value
encore:client:radiationExposurerate (drives the Geiger counter)
encore:client:playerDied / playerRevived
encore:client:survivalDamageddamage, causes
encore:client:zoneChangedzone, previous
encore:client:xpChangedinfo
encore:client:onMoneyChangemoneyType, amount, action, reason
pma-voice:radioActive

Seatbelt integration

EventTypeWhat it does
en-hud:client:setSeatbeltLocal client event, booleanSet the seatbelt indicator
seatbelt:client:ToggleSeatbeltNet eventToggle the indicator (works with qb-smallresources style seatbelt scripts)

Vehicle classes 8, 13, 14, 15, 16 and 21 have no seatbelt.

State bags

StateUsed for
LocalPlayer.state.proximity (mode, index)pma-voice range
LocalPlayer.state.radioChannelRadio indicator
Entity(vehicle).state.fuelFuel gauge (first source tried)

Examples

Hide the HUD during a cutscene and drive the seatbelt icon from your own script:

lua
-- client
exports['en-hud']:SetVisible(false)
-- ... play scene ...
exports['en-hud']:SetVisible(true)

-- a custom seatbelt script
TriggerEvent('en-hud:client:setSeatbelt', true)