Skip to main content

Pool::forEachFast

Server-side function

Calling for each entity in a pool. Same as forEach except faster at lookups. Do not use this for destroying entities.

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.forEachFast(function)

Parameters​

  • function - Function to be called

Examples​

Loops through printing out every vehicle ID in the server.

Server-Side

mp.vehicles.forEachFast((car) => {
console.log(`Car ID: ${car.id}`)
});