Skip to content

setAmbientPedPopulationZoneState

Client-side

Overrides selected native population fields for one GTA navigation zone inside the reversible population world state.

Syntax

bool setAmbientPedPopulationZoneState(string zoneLabel, table state)

Arguments

zoneLabelstring

GTA navigation-zone label.

statetable

Optional populationType, races, dealerStrength, noCops and gangStrengths fields.

Table keys

populationTypeintoptional

Native population type for the zone.

racestableoptional

Race weighting for the zone.

dealerStrengthintoptional

Native dealer strength.

noCopsbooloptional

Flags the zone as no-cops, which suppresses the ambient cop target.

gangStrengthstableoptional

Per-gang strength values.

Returns

true when the named zone and supplied fields were accepted; false otherwise.

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
  • Only fields present in the table are changed.
  • Use resetAmbientPedPopulationZonesToBootstrap to return to the stock campaign bootstrap.

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →