RDE_CARHUD DOCS
RED DRAGON ELITE // ECONOMY & GAMEPLAY · COMMUNITY BETA

Wheels Actually
Fall Off. Physically.

rde_carhud is an all-in-one vehicle cockpit suite: analog speedometer/RPM gauges, real wheel damage with physics-based drop-off, a 5-phase cascading engine failure system, and nitro — all StateBag-first, zero TriggerClientEvent spam for effects.

01 / Start Here

Overview

Dual primary gauges (speedometer + RPM), dual secondary gauges (fuel + engine temp), tire status FL/FR/RL/RR with 4 visual states, turbo boost and nitro bars, seatbelt with ejection mechanics, cruise control, and blinkers — all synced via StateBag, zero polling for effects.

Core Principle Zero TriggerClientEvent spam. A wheel breaking sets an entity StateBag once; every nearby client's AddStateBagChangeHandler fires immediately and applies the effect — no per-tick broadcast.

Why this over generic car HUDs

Generic Car HUDsrde_carhud
Realtime multi-player syncStateBag — event-driven, zero spam
Wheel damageFall + collision detection, physics prop spawn
Engine failure phases5-phase cascading system
External repair detectionAuto-detects fixkit/carservice/admin repairs
02 / Start Here

Quick Start

server.cfg
ensure oxmysql
ensure ox_core
ensure ox_lib
ensure ox_inventory
ensure rde_carhud

Table rde_vehicle_data auto-creates. Add rde_ersatzreifen, nitro, and fixkit items to ox_inventory's items.lua (snippets in the README).

03 / Reference

Wheel Damage

TriggerDetection
Fall damageZ-velocity impact + suspension compression multiplier + minimum airtime gate
Collision damageHealth delta + forward-vector dot-product to determine which wheel took the hit

On critical damage, wheels physically fall off with a velocity impulse matching the vehicle — real 3D prop, not a texture swap. Auto-repair detection catches fixkit, carservice, and admin /car fix via a 300ms health-check thread.

04 / Reference

Engine Failure Simulation

PhaseThresholdEffect
healthyNo effects
degrading<677 HPSlow passive decay, no visual
critical<310 HPLight oil smoke, driver notification
limp<100 HPHeavy smoke + oil drip + sparks, limp mode active
deadFloorThick smoke + fire, minimal power

Particles are entity-bone attached — smoke and fire follow the car at any speed. Petrol tank explosion is prevented, never dropping below 750 by design.

05 / Reference

Configuration

config.lua
Config.WheelDamage = {
    fallOffChance   = 100,  -- % chance wheel falls off (4-wheel vehicles)
    speedLimit      = 50.0, -- km/h max with a missing wheel
}

Config.VehicleFailure = {
    phaseThresholds = { degrading = 677.0, critical = 310.0, limp = 100.0 },
    preventExplosions = true,
}
06 / Reference

Developer API

ExportNotes
getVehicleFailurePhase(veh)'healthy'|'degrading'|'critical'|'limp'|'dead'
isWheelBroken(vehicleNetId, wheelIdx)Server — wheelIdx nil = check any wheel
fixAllWheels(vehicleNetId)Server — clears statebags, triggers restore
07 / Reference

Performance

ScenarioOverhead
On foot, not in any vehicle (v1.0.1)0.04–0.05ms / ~5–7% Time %
Driving, all systems active~0.08ms

Measured live via F8 Resource Monitor — the pre-v1.0.1 number was 0.44ms/33.87% Time%, a real production bug from a full vehicle-pool scan running every 10ms regardless of state.

08 / More

Common Pitfalls

Full-server vehicle pool scan every 10ms (pre-v1.0.1)

The exhaust flame thread called GetGamePool('CVehicle') every 10ms scanning every vehicle on the server, regardless of whether anyone had nitro active. This was ~88% of measured overhead.

Fix (v1.0.1): replaced with an ActiveNitroVehicles set maintained by the existing nitroActive StateBag handler — sleeps at 1000ms when the set is empty.

Engine stalls instantly when jacking a running NPC vehicle

Any vehicle with no prior rde_engineRunning StateBag record was treated as "engine off" and force-killed.

Fix (v1.0.1): now mirrors GetIsVehicleEngineRunning() when there's no prior record, instead of assuming off.

09 / More

FAQ

Does this need ESX or QBCore?

No — pure ox_core, ox_lib, ox_inventory stack.

Is this production-ready?

It's tagged Community Beta — core systems are tested and confirmed working, but some edge cases may remain. Report via GitHub Issues.

10 / More

Changelog

v1.0.1

Eliminated two full-server vehicle pool scans, fixed engine-state default-stopped bug, fixed vehicle-exit engine race condition.

v1.0.0-b

Community Beta — turbo/nitro bars, tire status HUD, passenger seatbelt indicator, entity-bone attached particles.