Skip to content

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

theVehiclevehicle

Vehicle 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

RELATED SA:O APIS

Continue exploring

Read the system guide →