Skip to content

setPedGoToOffset

Client-side

Tell an NPC to move to a chosen side and distance around another NPC. GTA tracks the other NPC while approaching that offset.

Syntax

bool setPedGoToOffset(ped thePed, ped target [, int timeout = -1, float radius = 0.5, float angle = 0.0, bool repeatTask = false])

GTA task mapping

ORIGINAL GTA TASK 06A8
CTaskComplexSeekEntityRadiusAngleOffsetCTaskComplexUseSequence

SCM equivalent: TASK_GOTO_CHAR_OFFSET

The seek task is the direct mapping. repeatTask=true wraps it in GTA's real repeating mission sequence instead of replaying movement from Lua.

Arguments

thePedped

Living streamed ped simulated by this client.

targetped

Distinct living streamed target ped.

timeoutintoptional · default -1

-1 for GTA's SCM-compatible 50-second seek timeout, or a non-negative timeout in milliseconds.

radiusfloatoptional · default 0.5

Finite positive distance from the target.

anglefloatoptional · default 0.0

Finite native angular offset around the target.

repeatTaskbooloptional · default false

Wrap the movement in GTA's native repeating mission sequence.

Returns

true when the native task or repeating sequence was queued; false when validation or construction fails.

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.

OOP aliases

  • ped:setGoToOffset(target, timeout, radius, angle, repeatTask)

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →