Pool::forEachFast

From RAGE Multiplayer Wiki
Revision as of 10:04, 21 April 2020 by MrPancakers2 (talk | contribs) (Created page with "__NOTOC__ {{ServersideJsFunction}} Calling for each entity in a pool. Same as forEach except faster at lookups. Do not use this for destroying entities. {{JSContainer| == Syn...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

JavaScript Syntax

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