Skip to content

getAmbientVehicleOccupantModelCandidate

Client-side

Ask GTA which pedestrian skins naturally fit a vehicle, so it can be created with a suitable driver and passengers.

Syntax

table|false getAmbientVehicleOccupantModelCandidate(int vehicleModelId [, int maximumOccupants = 4])

Arguments

vehicleModelIdint

Supported civilian road-vehicle model ID.

maximumOccupantsintoptional · default 4

Maximum number of proposed occupants, from 1 through 4.

Returns

An array of one to four pedestrian model IDs, or false when GTA cannot produce a compatible occupant list.

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 first model is used for the driver; any remaining models can be used for passengers.
  • The function creates no peds or vehicle.

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →