getAmbientPedGangGroupCandidate
Client-side
Asks GTA for a native ambient gang-group placement with two to four proposed members.
Syntax
table|false, string? getAmbientPedGangGroupCandidate(Vector3 origin, int gangId [, int maxMembers = 4])Arguments
originVector3Finite population origin.
gangIdintSupported native gang ID from 0 through 7.
maxMembersintoptional · default 4Maximum proposed group size from 2 through 4.
Returns
An array of member candidates with model, pedType, position, heading and gang metadata; or false plus a bounded miss reason.
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
- This is a placement oracle only. The server must validate and create the real group elements.
Where this comes from
SOURCECLuaWorldDefs.cppClient/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp INTRODUCED / EXTENDED39f782fd9Read 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 →