Skip to content

getAmbientPedCivilianCoupleCandidate

Client-side

Ask GTA for two compatible civilian skins and nearby path positions that can spawn together as a walking couple.

Syntax

table|false, string? getAmbientPedCivilianCoupleCandidate(Vector3 origin)

Arguments

originVector3

Finite world position around which GTA should look for the couple.

Returns

A couple table with two member records containing model, ped type, position, direction, path interpolation, heading, and civilian metadata; or false plus a bounded miss reason.

Ownership and lifecycle

Candidate queries create nothing. A multiplayer resource must validate each proposal, create and own the real NPCs and vehicles, assign one current syncer, handle ownership changes, and clean up every element. Native AI and event tokens belong to the calling resource and are revoked when that resource stops.

Important behavior
  • The function only proposes a pair and creates nothing. The server must validate the result, create both peds together, and assign one simulation owner.

Example

local couple, reason = getAmbientPedCivilianCoupleCandidate(localPlayer.position)
if couple then
for _, member in ipairs(couple.members) do
outputDebugString(("model %d at %.1f, %.1f, %.1f"):format(member.model, member.x, member.y, member.z))
end
end

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →