TasksClient

setDrivebyTaskTarget

SET_DRIVEBY_TASK_TARGET0xE5B302114D8162EE

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

SignatureJavaScript
setDrivebyTaskTarget(
  shootingPed: Ped,
  targetPed: Ped,
  targetVehicle: Vehicle,
  x: number,
  y: number,
  z: number
): void
SignatureLua
setDrivebyTaskTarget(
  shootingPed: Ped,
  targetPed: Ped,
  targetVehicle: Vehicle,
  x: number,
  y: number,
  z: number
)

Usage

JavaScript
setDrivebyTaskTarget(shootingPed, targetPed, targetVehicle, x, y, z);
Lua
setDrivebyTaskTarget(shootingPed, targetPed, targetVehicle, x, y, z)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
setDrivebyTaskTarget(shootingPed, targetPed, targetVehicle, pos);
Lua · with vectors
setDrivebyTaskTarget(shootingPed, targetPed, targetVehicle, pos)

Parameters

ParameterTypeJavaScriptLua
shootingPedPednumberinteger
targetPedPednumberinteger
targetVehicleVehiclenumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

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.

For p1 & p2 (Ped, Vehicle). I could be wrong, as the only time this native is called in scripts is once and both are 0, but I assume this native will work like setMountedWeaponTarget in which has the same exact amount of parameters and the 1st and last 3 parameters are right and the same for both natives.

Reference

Namespace
Tasks TASK
In the game
void SET_DRIVEBY_TASK_TARGET(Ped shootingPed, Ped targetPed, Vehicle targetVehicle, float x, float y, float z)
Hash
0xE5B302114D8162EE

Open in the interactive natives reference