Перейти к содержанию

Pool::forEachFast

Материал из RAGE MP Wiki Archive
Версия от 12:06, 10 ноября 2024; imported>Shr0x
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Server-Side
Function

Ошибка создания миниатюры: Не удаётся сохранить эскиз по месту назначения JavaScript



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 Pool Description
mp.players Manages all connected players
mp.vehicles Manages all spawned vehicles
mp.objects Manages all created objects
mp.peds Manages all non-player characters (peds)
mp.markers Manages all markers in the game
mp.labels Manages all 3D text labels
mp.checkpoints Manages checkpoints
mp.blips Manages map blips
mp.colshapes Manages 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}`)
});


See Also