Skip to main content

Pool::forEachInDimension

Server-side function

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​

void pool.forEachInDimension(int dimension, function callingFunction);

Required Arguments​

  • dimension: int The dimension in which to apply the function.
  • callingFunction: The function to be called for each entity in the specified dimension.

Example​

This example outputs the names of all players in dimension 0 (default dimension) to the server console.

Server-Side

mp.players.forEachInDimension(0, (player, id) => {
console.log("Player: " + player.name);
});