getVehicleStraightLineDistance
Client-side
Read the vehicle's current GTA autopilot straight-line distance value so it can be restored after a mission task.
Syntax
int|false getVehicleStraightLineDistance(vehicle theVehicle)GTA task mapping
NATIVE GTA BEHAVIOR
No CTask is created This is a CAutoPilot state query, not a CTask or SCM command.
Arguments
theVehiclevehicleVehicle whose native or stored value should be read.
Returns
The current value from 0 through 255, or false when no value is available.
Ownership and lifecycle
Door-lock, tyre-burst, physical-proof, and load-collision policies live on the MTA vehicle, apply immediately when its GTA instance is streamed, and are reapplied after local native recreation. They are client-local, last-writer-wins policies rather than resource-owned leases.
Important behavior
- The function reads the live GTA vehicle when streamed in and the locally stored override otherwise.
Where this comes from
SOURCECLuaVehicleDefs.cppClient/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp INTRODUCED / EXTENDEDcf508dcecRead the commit and why the change was made TEST RESOURCE native-task-cohort-test test-resources/native-task-cohort-test
RELATED SA:O APIS
Read the system guide → Continue exploring
← Back to the SA:O Lua API · How Native story vehicle state works →