Impact Dynamics / Developers

Vehicle condition state

What Impact Dynamics remembers about a car (bent wheels, jammed doors, a wrecked engine) is stored in the vehicle's entity state bag ryanImpact. Impact Dynamics writes it only from the server, from validated reports. Every client reads it, so a jam or a bent wheel is the same for everyone and stays when the driver gets out.

Lua
local condition = Entity(vehicle).state.ryanImpact     -- nil = nothing wrong

Shape

Lua
{
    w   = { ['0'] = { b = 0.32 }, ['1'] = { b = -0.05 } },   -- wheel index -> bend (-1.0 .. 1.0; sign = pull side)
    j   = { 0, 2 },                                            -- jammed doors
    js  = 3,                                                   -- how bad the crash that jammed them was (1 light .. 4 severe)
    x   = true,                                                -- wrecked by a rollover: engine dead until a repair
    srv = 123456,                                              -- internal stamp (see below)
}
Field Meaning
w Bent wheels by wheel index (0-7). b = bend, the absolute value is how bent; the sign is the direction it pulls.
j Jammed door indexes (0 front left, 1 front right, 2 rear left, 3 rear right).
js Severity of the crash that jammed the doors - sets the chance of climbing out a window. Only present with a jam.
x true = wrecked.
srv Internal stamp set when the server changed the condition (SetCondition, FreeDoor, a forced or kicked door). Harmless to save; SetCondition makes a new one.

Use the server exports to read / write it - SetCondition validates the table. Do not write the state bag yourself, and never from client code.

Things GTA keeps itself (body, engine and tank health, burst tyres, broken windows, wheels torn off) are not in it.

Still stuck? Open a ticket in the Ryan Studios Discord and we'll help you out.