Skip to content
DPS-EnhancedPublic

About

The DPS HUD for FiveM for GTAV Enhanced. One HUD owns the screen and scripts send it plain values.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

90 Commits

Folders and files

Repository files navigation

dps_hud

The DPS HUD, for FiveM for GTAV Enhanced. One HUD owns the screen. Scripts send it plain values.

What it is for

On most servers every script draws on the screen its own way. One floats text in the air, another draws its own bar, a third keeps repeating a notification. Nothing matches, and each one is another layer over the game.

Here one HUD draws everything, in one look. A script says what is true, such as "fuel is 17" or "tow the Sultan to Davis lot". The HUD decides how that looks, where it sits and when it fades.

The rule: left is me. Top left is where. Right is my vehicle. Health and armour are always there. Everything else joins when it matters and leaves when it does not.

What it shows by itself

Top left: where. The round minimap, always on, in a ring with N, E, S and W and small ticks. The street sits under it, then the area and the postal code. The postal comes from dps_core. A job line and up to three readouts sit beside it.

Bottom left: me. The status strip, one joined bar. Each status is a segment: an icon and a word. The fill is the level.

Segment When it is on the strip Fed by
Voice Always, at the front, while a voice script runs. Its word is how far the voice carries. It lights up while you talk. On the radio it names the channel and its edge turns pink. dps_comms
Health Always The game
Armour While you have any The game
Food, water Only when low, below 25 of 100 qbx_core
Stress Only at a real extreme, above 85 of 100 qbx_core
Bleeding, Injured While you bleed, or a body part is badly hurt dps_core, from the medical script
Stamina While it is being used, until it has filled back up The game
Air While you are underwater The game
Cuffed While you are in handcuffs. A state: a word with no fill, because it is a fact and not a level. qbx_core, set by the police script
Weapon Last on the strip, only while a weapon is in hand: an outline of its type, its name, and rounds in the clip then rounds left to load. The fill is the clip. A band sweeps across while it reloads. A knife shows its name alone. The inventory

The crosshair is the HUD's own: a small cream dot and four ticks in the middle of the screen, shown only while you aim. The ticks open while you fire or move. The game's own weapon icon, ammo count and crosshair are hidden while a weapon is out, so nothing default is left. A sniper's scope keeps the game's own view.

Bottom right: my vehicle. One bar: fuel, then speed as the end block. mph or km/h on the road, knots on water and in the air.

Part When
Fuel and speed While you drive, fly or sail
Height and climb In an aircraft. A helicopter reads height above the ground.
The heading dial In a boat or an aircraft only. A half-moon over the bar: heading, and a mark for the waypoint.
The horizon In an aircraft only. It tilts with bank and pitch.
The hover mark In a helicopter that is nearly still. It shows which way you are drifting.
Depth In a boat: the water under it, in metres
Warnings Above the bar: seatbelt off, engine damaged, too low in a plane, and whatever a script sets

Money shows beside the map for five seconds when cash or the bank changes, then leaves.

Only the driver, pilot or skipper gets the vehicle bar.

How a status behaves

These are tools, so the design is how they behave.

It does this When
The fill drains to the left As the level drops. The thin edge stays, so what is missing can be read.
Flashes twice On a hit: a drop of 3 in 100 or more at once
Deepens from orange to pink Past its low mark
Pulses three times, then holds red Far past the mark. It does not pulse for ever. A pulse that never stops is no longer read.

Race mode

A half dial over the vehicle's bar, in the place the heading dial takes in a boat or an aircraft. Speed and fuel do not move.

Part What it shows
The arc Engine revs. Orange, with the last part of the sweep, the red line, in pink.
The number The gear. R for reverse.
The inner arc Boost: turbo pressure. Only on a car with a turbo fitted.
The lit top edge Past the red line: change up
Four small blocks The tyres, laid out as the car is. Cream is sound, pink is worn, red is burst.
Two short bars The pedals. Orange is throttle, pink is brake.
Above the dial Small readings, there only while they matter: a 0 to 60 time and a quarter mile time from a standstill, in gold for a new best; the drift angle while sliding, with the best of this drive; the top speed, once a run is over. Two lamps sit in the same row: "Wheelspin" in pink and "Handbrake" in cream.
The ring beside the dial G force. The dot moves the way the driver is pushed: back under power, forward under braking, sideways in a corner. One whole G reaches the ring. The number is the size of the push.
"Engine hot" A warning beside the dial while the engine runs hot

It is a mode the driver turns on and off.

The button A small block at the front of the vehicle's bar. Dim is off, orange is on. The mouse steers the camera while you drive, so it takes a click only while the command box is open: press T, click it. A cream outline shows when it can be clicked.
/racemode The same, typed
A key None to begin with, so it cannot clash. A player sets one in Settings, Key Bindings, FiveM.
Remembered On the player's own PC, so it is still on next time
Shown Only while driving. Not on foot, not as a passenger.

A racing script can also switch the dial on for one car, whatever the driver has chosen:

Entity(vehicle).state:set('raceMode', true, true)

On duty

When a player goes on duty for an emergency department, the HUD shifts and stays that way until they go off duty. The layout, the shapes and the type do not move. What changes:

  • The colour. The fills and the edge take the department's colour in place of orange. A low or a critical level keeps its own colour in every department.
  • The duty block. The first block on the strip: the department and the callsign.
  • The tools. A small panel over the vehicle's bar. Lights and siren show by themselves in an emergency vehicle.
Department Colour Jobs in qbx_core
City police Cold blue police, lspd
Sheriff Brown bcso, sheriff
State troopers Grey sasp, highway, trooper
Parks Green parks, sapr, fishandwildlife
EMS Pale sky blue ambulance, ems, sams, lsmc
Fire Red lsfd, fire

The list of jobs is at the top of client/service.lua. Add a job's name there to give it a department.

Another script adds a tool with one call. The HUD decides how it is drawn.

exports.dps_hud:ServiceTool('radar', { tool = 'radar', front = 54, rear = 38, lock = 71 })
exports.dps_hud:ServiceTool('plate', { tool = 'plate', side = 'Front', plate = '8ABC123', note = 'Stolen', hit = true })
exports.dps_hud:ServiceTool('cam', { tool = 'rec', time = '04:12' })
exports.dps_hud:ServiceTool('radar', nil) -- take it away

The seatbelt

B Buckle or unbuckle. A player can change the key in Settings, Key Bindings, FiveM.
Getting in The belt starts unbuckled, every time. The player has to remember.
Getting out It comes off by itself.
Unbuckled, hard crash The player can be thrown through the windscreen. This is the game's own behaviour, on only while unbuckled.
Buckled Never thrown out
The reminder "Seatbelt off" sits above the vehicle bar while the belt is off and the vehicle is moving
No belt Motorcycles, bicycles, boats, helicopters, planes, trains

Another script can ask exports.dps_hud:HasSeatbelt().

The game's own cash, job text, area name, street name and vehicle name are hidden.

While a player is down the HUD steps back, so the medical prompts have the screen. It is hidden, not cleared. When they get up it all comes back.

The four slots

A script gets these and nothing else.

Slot What it is Example
dial A number, a unit, a ring Speed, altitude, fuel
readout A label and a value Lap 2 of 5
tracker One line for what you are doing now Tow the Sultan to Davis lot
warning Lights up, then clears Low fuel. Meter expired.

The calls

A script never names this resource. It calls dps_core.

On a player's own game:

exports.dps_core:Hud(slot, id, values)       -- set or update
exports.dps_core:HudClear(slot, id)          -- take away

On the server:

exports.dps_core:HudFor(target, slot, id, values)
exports.dps_core:HudClearFor(target, slot, id)

target is one player or a list of players, so a job can set a tracker for a whole crew in one call. A player's game can set only its own screen. Only the server can set another player's.

What each slot takes

dial

Value Meaning
value The number. Needed.
max The top of the ring. 100 when left out.
kind speed, altitude, fuel, health, armour, hunger, thirst, stress, air, stamina, depth. Decides where it sits and how it is drawn.
unit A short unit, such as feet. Not for speed: see below.
glyph A name from the list below
lowBelow, highAbove Where it lights up. One or both.
quiet true hides it while the value is fine. It shows when it crosses a mark, or for a few seconds after it moves.

For speed a script sends kind = 'speed' and the raw number in metres a second. No script picks the unit. The HUD shows mph or km/h by the server's setting, and knots in a boat or an aircraft.

The HUD glides between values, so a few updates a second look smooth.

readout

Value Meaning
label The small word above
value The words or number shown
countdown Seconds. The HUD counts down by itself.
countup Seconds to start from. The HUD counts up by itself.
stop true freezes the clock where it is
glyph A name from the list below

The HUD only shows a clock. It never decides anything. The script that owns it, on the server, decides when a meter expired or a lap ended. Do not build a rule on the HUD's clock.

tracker

Value Meaning
text The one line

warning

Value Meaning
text The words
level quiet is simply true. look lights up cream. now is red. look when left out.
seconds Clears itself after this long. Without it, it stays until cleared.
glyph A name from the list below

Setting a warning again with the same values does nothing. Setting it again with different values updates it. So a script can say "low fuel" as often as it likes and the screen is not flooded.

What a script cannot send

A colour, a size, a position, a picture file or HTML. Only the values above are read. Anything else is dropped. Every piece of text is cut to plain characters and a set length.

Glyphs

A script names a glyph from this list. A name that is not on it shows no glyph. That is not an error. The list grows by request. A script never ships its own picture.

health armour hunger thirst stress air stamina fuel engine belt anchor depth gear low hook clock pin mic ammo

Whose is whose

  • What a script sets belongs to it. Two scripts using the same id each get their own.
  • A script can only change or clear what it set.
  • When a script stops, everything it set is cleared.

How many show at once

Slot Shows The rest
Tracker 1 The newest wins. The older one returns when the newer clears.
Readout 3, and 2 at most from one script Oldest first. A countdown in its last 30 seconds jumps the queue.
Dial 8 The HUD's own come first
Warning 3 Red before cream before quiet

When a player's HUD is cleared

Event What happens
They drop Everything goes
They switch character Everything a script set is cleared
They go down Everything is hidden, and comes back when they get up. A red warning stays.

An example: a tow job

-- Server, when the job starts. One call for the whole crew.
exports.dps_core:HudFor(crew, 'tracker', 'job',  { text = 'Tow the Sultan RS to Davis lot' })
exports.dps_core:HudFor(crew, 'readout', 'pay',  { label = 'Pay', value = '$180' })
exports.dps_core:HudFor(crew, 'readout', 'time', { label = 'Time', countup = 0 })

-- The driver's game, while the hook is off.
exports.dps_core:Hud('warning', 'hook', { text = 'Hook not attached', level = 'look', glyph = 'hook' })

-- Server, when the job ends.
exports.dps_core:HudClearFor(crew, 'tracker', 'job')

Stepping back

The HUD is a page laid over the game, not part of the game's own HUD. So when a photo tool, a cutscene or a camera tells the game to hide its HUD, the HUD hears it and steps back: the whole page fades out, every part at once, so nothing shows through. It steps back while:

  1. any script hides the game's HUD (DisplayHud(false) or HideHudAndRadarThisFrame). This covers JG Vehicle Studio, the phone camera and video calls, the police heli camera and the inventory, with no change to them;
  2. the screen is faded to black, or fading;
  3. a cutscene or a character switch is playing;
  4. one of our scripts asks for it.

It fades back in when all of them have cleared. A camera being moved is not on the list: the fleet workshop and some menus use cameras where the HUD is wanted.

-- Client. Each owner is counted on its own; the HUD returns when every owner has let go.
exports.dps_hud:Away('fleet', true)   -- step back
exports.dps_hud:Away('fleet', false)  -- let go

A script that stops while holding the HUD back lets go of it. Each step back and return is written to the troubleshooting log with its reason (setr dps:log 1).

The look

Version 2 of the DPS look, section 9d. This HUD is the model for every screen in the pack.

Blocky joined segments, rounded only at the outer ends. Slanted capitals for labels, in Barlow Condensed. Heavy numbers in Unbounded. A dark haze behind, an orange fill for the level, and a thin orange edge that stays. Orange is kept for the thing that matters.

Every size is a share of the screen's height, and everything is placed from the game's own safe area. So it holds its place and proportion on any screen from 1080 high and up, ultrawide included.

No blur. Nothing is loaded from the internet: the fonts ship in web/fonts, with their licence beside them.

Moving the parts

An admin can move each part of the HUD, for the whole city, and lock it.

Command What it does
/hudlayout Opens the editor. Tab picks the part. Arrows move it, Shift for bigger steps. Enter saves for every player. Backspace puts the part back.
/hudlayout lock No one can move anything until it is unlocked
/hudlayout unlock

The parts are the map, the lines beside it, the status strip, the vehicle bar and the warnings. The map and its ring move as one.

What it costs

  • One screen layer, for three jobs. The HUD, the city's short sounds and the command box with its bubbles all live on this one page. Before, that was three pages.
  • One loop runs every frame. It hides the game's own cash, job, area, street and vehicle text. The game only offers "hide this for one frame", so it has to.
  • Health is read twice a second. The vehicle dials ten times a second, and only while you drive.
  • Food, water, stress, injuries and money have no loop. They are read when the game says they changed.
  • Whether you are talking is asked five times a second.
  • Ammo is read five times a second, and only while a weapon is in hand.
  • The seatbelt reminder looks twice a second, and only while you are in a vehicle with a belt.
  • The page is only sent a message when what is on screen changes.

Not yet measured in game.

Requirements

  • ox_lib
  • dps_core is how every script reaches it, and it reports injuries

Each of these feeds one part. Without it, that part is simply not shown.

  • qbx_core: food, water, stress, money
  • dps_comms: voice
  • ox_inventory: ammo

Install

It comes with the pack. In server.cfg it starts before dps_lib and dps_core:

ensure dps_hud
ensure dps_lib
ensure dps_core

The command box

The command box, the /me bubbles over heads and the minimap ring belong to dps_chat. They are drawn on this page.

This resource is only the bridge. dps_chat keeps every rule: which commands a player sees, what a command does, who gets a bubble. Only dps_chat can use this part of the page. If dps_chat stops while its box is open, the HUD gives the player their keyboard back.

The box opens on the status strip and joins onto its front. The strip slides over to make room, so it reads as one bar that grew. There is no feed of messages. An admin who has placed the box elsewhere with /chatbox gets it standing alone.

The page side is web/chat.js and web/chat.css.

Sounds

The HUD's page also plays the city's short sounds, such as the click of handcuffs, so no second hidden page is needed only for sound.

dps_lib decides who hears what, on the server. Only dps_lib can ask this page to play one. The files are in web/sounds. They come from interact-sound, MIT licence, copyright 2017 Scott Plunkett. His licence text is beside them.

Settings

At the top of client/own.lua.

healthLowBelow = 50,      -- health deepens below this
fuelLowBelow = 20,        -- fuel deepens below this
minimapOnFoot = true,     -- the minimap is on everywhere
speedStyle = 'block',     -- speed is the end block of the vehicle bar
radarZoomOnFoot = 1200,   -- how far out the minimap looks on foot
radarZoomInVehicle = 1100, -- and in a vehicle

The HUD owns the minimap, so it sets the minimap's zoom, inside the loop it already runs every frame. A map resource should not run a loop of its own for it.

The marks for food, water, stress and injuries are at the top of client/body.lua.

And one server setting, for the road unit:

setr dps_hud:roadUnit "mph"     # or "kmh"

For a test server only

These work only while the troubleshooting log is on, setr dps:log 1. Do not set that on a live city.

Command What it does
/hudtest foot, body, states, weapon, car, race, air, heli, boat, off Fills the HUD with sample values, so every part can be seen without a weapon, an injury or an aircraft
/hudring Nudges the ring around the map by hand

Preview pages

Pages in web for looking at the HUD in a browser. They are not loaded in game.

  • look.html plays the HUD through its moments: a hit, low health, talking, a weapon out, getting paid, the command box, a car, a plane, a helicopter in a hover, a boat.
  • zones.html checks that no two parts overlap, at each screen size.

What is planned

  • Race mode for race cars: a half dial with speed, revs and boost.
  • Radar, a plate reader and a body camera, sent by their own scripts through ServiceTool.
  • A harness, with race mode.
  • A guide line on the ground for the GPS.
  • A player's own choice of mph or km/h.

Known limits

  • The parts added in v0.7.0 are not yet tried in game.
  • The cost in frame time is not yet measured.
  • Only the driver gets the vehicle bar. A passenger gets nothing yet.
  • Made for screens 1080 high and up. A smaller screen works, but small.

Licence

GPL-3.0-or-later. See LICENSE.

Recent changes

  • 5 December 2026, v0.11.0. The HUD steps back when the game's HUD is hidden, the screen is faded, or a cutscene plays, and on request with exports.dps_hud:Away. Seen on the test server: the HUD showed through JG Vehicle Studio photos. Not yet seen in game.
  • 1 December 2026, v0.10.0. On duty: the HUD takes the department's colour, shows a duty block with the callsign, and shows lights and siren in an emergency vehicle. Department colours as the owner set them: troopers grey, sheriff brown, parks green, EMS blue, fire red. An export for other scripts to add a tool. Not yet seen in game.
  • 30 November 2026, v0.7.0. The weapon in hand on the strip, and the HUD's own crosshair. The game's weapon icon, ammo count and crosshair are hidden. Stamina, air and cuffed. Race mode. The strip and the vehicle's bar keep a gap from the screen edge at any safe-zone setting.
  • 30 November 2026, v0.6.0. Voice, food, water, stress, bleeding, injuries and ammo on the status strip. Money beside the map when it changes. A seatbelt on B. The command box joins the front of the strip. Test views for every part.
  • 30 November 2026, v0.5.0. The look, version 2: the joined status strip, the vehicle bar, the heading dial, horizon and hover mark for boats and aircraft, and orange compass letters.
  • 30 November 2026, v0.4.0. The round minimap, top left, always on, in a ring with the compass, fitted to any screen from the game's safe area. Street and area under it. Every part can be moved and locked by an admin.
  • 29 November 2026, v0.3.0. The command box, the bubbles over heads and the minimap ring are drawn on this page for dps_chat, which no longer needs a page of its own.
  • 29 November 2026, v0.2.0. The city's short sounds play from this page. dps_lib no longer needs a page of its own.
  • 29 November 2026, v0.1.0. First version: the four slots, the clocks, ownership by script, fairness between scripts, and the HUD's own health, armour, speed, fuel and height. The game's own cash and job text are hidden. Starts clean. Not yet tried in game.

About

The DPS HUD for FiveM for GTAV Enhanced. One HUD owns the screen and scripts send it plain values.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages