Skip to content

setPedDriveBy

Client-side

Available in Neon, not standard MTA

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

ORIGINAL GTA TASK 0713
CTaskSimpleGangDriveBy

SCM 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

thePedped

Living streamed script ped simulated by this client.

targetped|vehicle|Vector3

Distinct live streamed ped, distinct non-blown streamed vehicle, or finite world coordinate.

abortRangefloat

Finite non-negative native abort distance.

stylestring|intoptional · default ai_all_directions

Integer 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 false

Native right-hand-seat selector; false selects the left-hand side.

frequencyintoptional · default 100

Firing 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.

Important behavior
  • 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

RELATED NEON APIS

Continue exploring

Read the system guide →