The Lab
TASK native

TASK_DRIVE_BY

returns void10 paramsbuild 1207

Tasks driverPed to shoot from its vehicle at a ped, vehicle or position, with the given accuracy and firing pattern.

Signature

C
void TASK_DRIVE_BY(Ped driverPed, Ped targetPed, Vehicle targetVehicle, float targetX, float targetY, float targetZ, float distanceToShoot, int pedAccuracy, BOOL p8, Hash firingPattern); // 0x2F8AF0E82773A171 b1207

Parameters

#NameType
1driverPedPed
2targetPedPed
3targetVehicleVehicle
4targetXfloat
5targetYfloat
6targetZfloat
7distanceToShootfloat
8pedAccuracyint
9p8BOOL
10firingPatternHash

Facts

Facts about TASK_DRIVE_BY
Name
TASK_DRIVE_BY
Hash
0x2F8AF0E82773A171
Namespace
Returns
void
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
Citizen.InvokeNative(0x2F8AF0E82773A171, -- TASK_DRIVE_BY
  PlayerPedId(), -- Ped driverPed
  PlayerPedId(), -- Ped targetPed
  0, -- Vehicle targetVehicle
  0.0, -- float targetX
  0.0, -- float targetY
  0.0, -- float targetZ
  0.0, -- float distanceToShoot
  0, -- int pedAccuracy
  false, -- BOOL p8
  GetHashKey("name") -- Hash firingPattern
)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
Citizen.invokeNative("0x2F8AF0E82773A171", // TASK_DRIVE_BY
  PlayerPedId(), // Ped driverPed
  PlayerPedId(), // Ped targetPed
  0, // Vehicle targetVehicle
  0.0, // float targetX
  0.0, // float targetY
  0.0, // float targetZ
  0.0, // float distanceToShoot
  0, // int pedAccuracy
  false, // BOOL p8
  GetHashKey("name") // Hash firingPattern
);
C#
Function.Call((Hash)0x2F8AF0E82773A171, // TASK_DRIVE_BY
  API.PlayerPedId(), // Ped driverPed
  API.PlayerPedId(), // Ped targetPed
  0, // Vehicle targetVehicle
  0.0f, // float targetX
  0.0f, // float targetY
  0.0f, // float targetZ
  0.0f, // float distanceToShoot
  0, // int pedAccuracy
  false, // BOOL p8
  (uint)API.GetHashKey("name") // Hash firingPattern
);
All TASK natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.