Seatbelt & HUD scripts
Seatbelt
Belted occupants get a shorter daze and blackout. Impact Dynamics reads player state bags your seatbelt script sets - any of these keys being true counts as belted:
Config.ScreenEffects.SeatbeltStateBags = { 'seatbelt', 'harness' }
Add the key your seatbelt script uses. If it does not set a state bag, add one line to it where the belt toggles:
LocalPlayer.state:set('seatbelt', isBuckled, true)
Impact Dynamics only reads the belt - it never throws players out of the car. Ejection stays with your seatbelt script.
Showing tyre & alignment on your HUD
Impact Dynamics tells the driver with ox_lib notifications. To show it on your HUD as well, listen to the local client event - it fires whenever the status changes, and with veh = false when the player stops driving:
AddEventHandler('ryan-impactdynamics:client:wheels', function(data)
-- data.veh = vehicle handle, or false (not driving any more)
-- data.tyre = 0 fine, 1 pressure dropping (slow leak), 2 flat / burst / wheel gone
-- data.align = 0 fine, 1 bent, 2 badly bent
end)
Or read it whenever you want:
local status = exports['ryan-impactdynamics']:GetVehicleStatus(vehicle)
-- { tyre = 0-2, align = 0-2, alignment = 0.0-1.0, fuelLeak = %/s, jammed = { doors }, wrecked = bool }
Hiding your HUD during a blackout
The blackout covers the screen with a black overlay. If your HUD is drawn above it, hide it with:
AddEventHandler('ryan-impactdynamics:client:blackout', function(isBlack)
exports['my-hud']:SetVisible(not isBlack)
end)
Turning our notifications off
Players can turn the notes off themselves (/impactsettings). To turn them off for everyone because your HUD shows the status instead:
Config.PlayerSettings.Defaults.notify = false
Config.PlayerSettings.Locked = { notify = true }
This turns off the flat tyre, alignment, wheel, fuel leak and wrecked engine notes. Jammed-door and sweeping messages still show.