TasksClient

taskVehicleEscort

TASK_VEHICLE_ESCORT0x0FA6E4B75F302400

The GTA V native TASK_VEHICLE_ESCORT of the TASK namespace, as LS:MP client scripts call it: the global function taskVehicleEscort, in JavaScript and in Lua.

SignatureJavaScript
taskVehicleEscort(
  ped: Ped,
  vehicle: Vehicle,
  targetVehicle: Vehicle,
  mode: number,
  speed: number,
  drivingStyle: number,
  minDistance: number,
  minHeightAboveTerrain: number,
  noRoadsDistance: number
): void
SignatureLua
taskVehicleEscort(
  ped: Ped,
  vehicle: Vehicle,
  targetVehicle: Vehicle,
  mode: integer,
  speed: number,
  drivingStyle: integer,
  minDistance: number,
  minHeightAboveTerrain: integer,
  noRoadsDistance: number
)

Usage

JavaScript
taskVehicleEscort(
  ped, vehicle, targetVehicle, mode, speed, drivingStyle, minDistance, minHeightAboveTerrain,
  noRoadsDistance
);
Lua
taskVehicleEscort(
    ped, vehicle, targetVehicle, mode, speed, drivingStyle, minDistance, minHeightAboveTerrain,
    noRoadsDistance
)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
vehicleVehiclenumberinteger
targetVehicleVehiclenumberinteger
modeintnumberinteger
speedfloatnumbernumber
drivingStyleintnumberinteger
minDistancefloatnumbernumber
minHeightAboveTerrainintnumberinteger
noRoadsDistancefloatnumbernumber

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Makes a ped follow the targetVehicle with <minDistance> in between.

note: minDistance is ignored if drivingstyle is avoiding traffic, but Rushed is fine.

Mode: The mode defines the relative position to the targetVehicle. The ped will try to position its vehicle there.
-1 = behind
0 = ahead
1 = left
2 = right
3 = back left
4 = back right

if the target is closer than noRoadsDistance, the driver will ignore pathing/roads and follow you directly.

Driving Styles guide: https://gtaforums.com/topic/822314-guide-driving-styles/

Reference

Namespace
Tasks TASK
In the game
void TASK_VEHICLE_ESCORT(Ped ped, Vehicle vehicle, Vehicle targetVehicle, int mode, float speed, int drivingStyle, float minDistance, int minHeightAboveTerrain, float noRoadsDistance)
Hash
0x0FA6E4B75F302400

Open in the interactive natives reference