resetAmbientPedPopulationModels
Client-side
Releases the stock population-model residency established by the ambient-ped update pass.
Syntax
bool resetAmbientPedPopulationModels()Returns
true after the reset request, including when no ambient population slots were 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 native clear routine removes only its KEEP_IN_MEMORY pins; live MTA peds and resource model references continue to protect their models.
- The reference resource calls this when traffic is disabled and during client resource shutdown. Game reset and teardown also clear the state.
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 →