Skip to content

validatePedNativeCouple

Client-side

Pre-flight check that reports whether two peds can form a native GTA couple and which one should lead.

Syntax

table|false validatePedNativeCouple(ped a, ped b)

Arguments

aped

First candidate ped simulated by this client.

bped

Second candidate ped simulated by this client.

Returns

A table with compatible, aLeader, leaderIndex, walkSpeedA and walkSpeedB; false without resource context or when the pair cannot be evaluated.

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
  • Leadership is derived from the two native walk speeds. A pair with incompatible speeds would immediately exceed its own give-up distance.
  • Pass the returned leaderIndex straight into acquirePedNativeCouple; that is the intended flow.
  • This creates nothing and leases nothing.

Example

local check = validatePedNativeCouple(pedA, pedB)
if check and check.compatible then
local token = acquirePedNativeCouple(pedA, pedB, check.leaderIndex)
end

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →