TASK_DRIVE_BY
Tasks driverPed to shoot from its vehicle at a ped, vehicle or position, with the given accuracy and firing pattern.
Signature
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 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | driverPed | Ped |
| 2 | targetPed | Ped |
| 3 | targetVehicle | Vehicle |
| 4 | targetX | float |
| 5 | targetY | float |
| 6 | targetZ | float |
| 7 | distanceToShoot | float |
| 8 | pedAccuracy | int |
| 9 | p8 | BOOL |
| 10 | firingPattern | Hash |
Facts
| 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.
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
)// 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
);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
);Related TASK natives
- TASK_MOVE_NETWORK_ADVANCED_BY_NAME_WITH_INIT_PARAMS
- TASK_MOVE_NETWORK_ADVANCED_BY_NAME_WITH_INIT_PARAMS_ATTACHED
- TASK_MOVE_NETWORK_BY_NAME
- TASK_MOVE_NETWORK_BY_NAME_WITH_INIT_PARAMS
- TASK_VEHICLE_DRIVE_STRAIGHT_TO_POINT
- TASK_VEHICLE_DRIVE_TO_COORD
- TASK_VEHICLE_DRIVE_TO_DESTINATION
- TASK_VEHICLE_DRIVE_WANDER
- _TASK_VEHICLE_DRIVE_TO_COORD_2
- _TASK_VEHICLE_DRIVE_TO_DESTINATION_2
- _TASK_VEHICLE_DRIVE_TO_POINT_2
- CLEAR_DRIVEBY_TASK_UNDERNEATH_DRIVING_TASK
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.