Skip to main content

Pool::toArray

Summary​

This function converts a pool to an array.

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

Syntax​

mp.pool.toArray();

Example​

Server-Side

const onlinePlayers = mp.players.toArray();
if (onlinePlayers.every(player => player.isAiming)) {
console.log("Everyone is aiming.");
}