setAmbientPedPopulationZoneState
Overrides selected native population fields for one GTA navigation zone inside the reversible population world state.
Syntax
bool setAmbientPedPopulationZoneState(string zoneLabel, table state)Arguments
zoneLabelstringGTA navigation-zone label.
statetableOptional populationType, races, dealerStrength, noCops and gangStrengths fields.
Table keys
populationTypeintoptionalNative population type for the zone.
racestableoptionalRace weighting for the zone.
dealerStrengthintoptionalNative dealer strength.
noCopsbooloptionalFlags the zone as no-cops, which suppresses the ambient cop target.
gangStrengthstableoptionalPer-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.
- Only fields present in the table are changed.
- Use resetAmbientPedPopulationZonesToBootstrap to return to the stock campaign bootstrap.
Where this comes from
Continue exploring
← Back to the SA:O Lua API · How Synchronized NPCs and road traffic works →