updateAmbientPedPopulationModels
Client-side
Runs GTA's ped-only zone-model residency pass around an origin without enabling unmanaged population creation.
Syntax
bool updateAmbientPedPopulationModels(Vector3 origin)Arguments
originVector3Finite world position whose native population zone should be kept current.
Returns
true after the native residency pass runs; argument validation reports an error for an invalid vector.
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
- Call this while candidate generation is active, normally from onClientPreRender as the reference resource does.
- The pass can retain up to eight stock population models and creates no ped. Call resetAmbientPedPopulationModels when generation stops.
Where this comes from
SOURCECLuaWorldDefs.cppClient/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp INTRODUCED / EXTENDEDb159bcd0cRead 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 →