--  LUA  GetGamePool

0x2B9D4F50

-- GET_GAME_POOL
local retval --[[ object ]] =
	GetGamePool(
		poolName --[[ string ]]
	)

Parameters:

    poolName:

    The pool name to get a list of entities from.

Returns:

An array containing entity handles for each entity in the named pool.

Returns a list of entity handles (script GUID) for all entities in the specified pool - the data returned is an array as follows:

[ 770, 1026, 1282, 1538, 1794, 2050, 2306, 2562, 2818, 3074, 3330, 3586, 3842, 4098, 4354, 4610, ...]

Supported pools

    CPed
    : Peds (including animals) and players.
    CObject
    : Objects (props), doors, and projectiles.
    CVehicle
    : Vehicles.
    CPickup
    : Pickups.

Examples:

    Lua

local vehiclePool = GetGamePool('CVehicle') -- Get the list of vehicles (entities) from the pool

for i = 1, #vehiclePool do -- loop through each vehicle (entity)

    if GetPedInVehicleSeat(vehiclePool[i], -1) == 0 then

        DeleteEntity(vehiclePool[i]) -- Delete vehicles (entities) that don't have a driver

    end

end
 
 

Parameters:

header:

sentence.

header:

sentence.

header:

sentence.

Returns:

sentence.

Summary

sentence.

Example

---  
    


Additional natives used in this example, or natives commonly used with this native.

NATIVE, NATIVE

Common Errors or Problems

Problem: sentence.

Problem: sentence.

Problem: sentence.

Credits and Disclaimers

The base of this data was taken from the redm/cfx fivem/rdr docs, and vespura. We have been saving and making notes for two years now, and are now adding them to our site for everyone to use. We will be modifying the notes as needed, and building tutorials around the data so these pages will change as we work on it. This is a manual process, not an automated one, so updates will occur as we have time, the priority is releasing resources. Thanks for your patience.

Was the documentation useful?

Related Examples and Posts