setPedDriveBy
Queues GTA's native gang drive-by task for an owned script ped already riding in an owned vehicle.
Syntax
bool setPedDriveBy(ped thePed, ped|vehicle|Vector3 target, float abortRange [, string|int style = "ai_all_directions", bool seatRHS = false, int frequency = 100])GTA task mapping
0713 CTaskSimpleGangDriveBySCM equivalent: TASK_DRIVE_BY
Neon preserves GTA's safe target reference or copied coordinate and sets the script-command marker before ordinary task dispatch.
Arguments
thePedpedLiving streamed script ped simulated by this client.
targetped|vehicle|Vector3Distinct live streamed ped, distinct non-blown streamed vehicle, or finite world coordinate.
abortRangefloatFinite non-negative native abort distance.
stylestring|intoptional · default ai_all_directionsInteger 0..8 or fixed_lhs, fixed_rhs, start_from_lhs, start_from_rhs, ai_side, fixed_fwd, fixed_back, ai_fwd_back, or ai_all_directions.
seatRHSbooloptional · default falseNative right-hand-seat selector; false selects the left-hand side.
frequencyintoptional · default 100Firing frequency percentage from 0 through 100.
Returns
true when GTA accepted the scripted task; false when ownership, ped, vehicle, target, range, style, frequency, or task construction is invalid.
Ownership and lifecycle
Low-level ped task calls require the client that simulates the living, streamed ped. Driving tasks also require control of the streamed vehicle. They do not create lifecycle handles; the optional native-task-runtime adds server-owned route epochs and reconstruction for drive_to routes. Gang-tag ownership is resource-exclusive, survives object streaming and recreation, and is released automatically when the owner stops.
- The task is immediate and has no completion event or resource-owned handle.
- Neon redirects only script-command mission actors through GTA's AI aim, animation, IK, and NPC spread paths. Local and remote player drive-bys retain MTA's existing input, camera, and hitbox behavior.
OOP aliases
ped:setDriveBy(target, abortRange, style, seatRHS, frequency)
Where this comes from
Continue exploring
← Back to the Neon Lua API · How Native ped tasks and gang tags works →