FiveM Docs / Native Reference
API Set:
  • all
  • server
  • client
Language:
  • raw
  • lua
  • c#
  • js
Namespace: CFXAPI set: sharededitImprove

GET_GAME_POOL

0x2B9D4F50
// GetGamePool
object GET_GAME_POOL(char* poolName);
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.
  • CNetObject: Networked objects
  • 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
Privacy
•
Cookie Policy
•
Cookie Settings
GET_ENTITY_COORDS(Entity entity)
GET_ENTITY_FROM_STATE_BAG_NAME(char* bagName)
GET_ENTITY_HEADING(Entity entity)
GET_ENTITY_HEALTH(Entity entity)
GET_ENTITY_INDEX_FROM_MAPDATA(int mapdata, int entity)
GET_ENTITY_MAPDATA_OWNER(Entity entity, int* mapdataHandle, int* entityHandle)
GET_ENTITY_MAX_HEALTH(Entity entity)
GET_ENTITY_MODEL(Entity entity)
GET_ENTITY_ORPHAN_MODE(Entity entity)
GET_ENTITY_POPULATION_TYPE(Entity entity)
GET_ENTITY_ROTATION(Entity entity)
GET_ENTITY_ROTATION_VELOCITY(Entity entity)
GET_ENTITY_ROUTING_BUCKET(Entity entity)
GET_ENTITY_SCRIPT(Entity entity)
GET_ENTITY_SPEED(Entity entity)
GET_ENTITY_TYPE(Entity entity)
GET_ENTITY_VELOCITY(Entity entity)
GET_EXTERNAL_KVP_FLOAT(char* resource, char* key)
GET_EXTERNAL_KVP_INT(char* resource, char* key)
GET_EXTERNAL_KVP_STRING(char* resource, char* key)
GET_FUEL_CONSUMPTION_RATE_MULTIPLIER()
GET_FUEL_CONSUMPTION_STATE()
GET_GAME_BUILD_NUMBER()
GET_GAME_NAME()
GET_GAME_POOL(char* poolName)
GET_GAME_TIMER()
GET_GLOBAL_PASSENGER_MASS_MULTIPLIER()
GET_HASH_KEY(char* model)
GET_HELI_BODY_HEALTH(Vehicle heli)
GET_HELI_DISABLE_EXPLODE_FROM_BODY_DAMAGE(Vehicle heli)
GET_HELI_ENGINE_HEALTH(Vehicle heli)
GET_HELI_GAS_TANK_HEALTH(Vehicle heli)
GET_HELI_MAIN_ROTOR_DAMAGE_SCALE(Vehicle heli)
GET_HELI_MAIN_ROTOR_HEALTH(Vehicle vehicle)
GET_HELI_PITCH_CONTROL(Vehicle heli)