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.
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.
Why this over generic car HUDs
| Generic Car HUDs | rde_carhud |
|---|---|
| Realtime multi-player sync | StateBag — event-driven, zero spam |
| Wheel damage | Fall + collision detection, physics prop spawn |
| Engine failure phases | 5-phase cascading system |
| External repair detection | Auto-detects fixkit/carservice/admin repairs |
Quick Start
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).
Wheel Damage
| Trigger | Detection |
|---|---|
| Fall damage | Z-velocity impact + suspension compression multiplier + minimum airtime gate |
| Collision damage | Health 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.
Engine Failure Simulation
| Phase | Threshold | Effect |
|---|---|---|
| healthy | — | No effects |
| degrading | <677 HP | Slow passive decay, no visual |
| critical | <310 HP | Light oil smoke, driver notification |
| limp | <100 HP | Heavy smoke + oil drip + sparks, limp mode active |
| dead | Floor | Thick 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.
Configuration
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,
}
Developer API
| Export | Notes |
|---|---|
| getVehicleFailurePhase(veh) | 'healthy'|'degrading'|'critical'|'limp'|'dead' |
| isWheelBroken(vehicleNetId, wheelIdx) | Server — wheelIdx nil = check any wheel |
| fixAllWheels(vehicleNetId) | Server — clears statebags, triggers restore |
Performance
| Scenario | Overhead |
|---|---|
| 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.
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.
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.
Changelog
Eliminated two full-server vehicle pool scans, fixed engine-state default-stopped bug, fixed vehicle-exit engine race condition.
Community Beta — turbo/nitro bars, tire status HUD, passenger seatbelt indicator, entity-bone attached particles.