getAmbientPedPopulationProfile
Client-side
Returns GTA's current ambient population targets, zone state, density multipliers, and gang weights.
Syntax
table|false getAmbientPedPopulationProfile()Returns
A table containing civilian, cop, gang and dealer targets, supportedTarget, density and creation-distance fields, zone metadata, worldLevel, copSuppressionFlags, zoneLabel, and ten gang weights; false when the native population state is not active.
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 profile is read-only. A server still decides how many shared MTA peds to create.
- dealerTarget is part of the current native popcycle calculation even though dealers are not counted as ordinary GTA total-ped occupancy.
- rawCopTarget keeps the unmodified popcycle result while copTarget applies the normal ambient-cop guards.
- copSuppressionFlags is a bitfield naming which guard reduced the cop target: 1 zone no-cops, 2 random cops disabled, 4 gang war being fought, 8 high altitude.
- worldLevel and zoneLabel identify the native world level and navigation zone the profile was computed for.
Where this comes from
SOURCECLuaWorldDefs.cppClient/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp INTRODUCED / EXTENDED5318f4360Read the commit and why the change was made TEST RESOURCE native-ped-traffic test-resources/native-ped-traffic
RELATED SA:O APIS
Read the system guide → Continue exploring
← Back to the SA:O Lua API · How Synchronized NPCs and road traffic works →