Skip to main content

Pool::size

Summary​

A property to get an element pool size, useful to be used in explicit array size declaration or manual for loop size (non foreach).

Note: This property is read only

Available Entity Pools​

The following are the main entity pools available on the RAGEMP, used for managing various game entities:

Entity PoolDescription
mp.playersManages all connected players
mp.vehiclesManages all spawned vehicles
mp.objectsManages all created objects
mp.pedsManages all non-player characters (peds)
mp.markersManages all markers in the game
mp.labelsManages all 3D text labels
mp.checkpointsManages checkpoints
mp.blipsManages map blips
mp.colshapesManages collision shapes

Return Value​

  • Number - Size of pool

Example​

// Example of using the size property
let vehicleCount = mp.vehicles.size;
console.log(`There are ${vehicleCount} vehicles on the server.`);