Pool::forEachInDimension: Difference between revisions

From RAGE Multiplayer Wiki
(Initial description)
 
(Fix)
Line 6: Line 6:
</syntaxhighlight>  
</syntaxhighlight>  
===Required Arguments===
===Required Arguments===
*'''Dimension:''' Dimension
*'''Dimension:''' Int, dimension
*'''callingFunction:''' Function, what will be called.
*'''callingFunction:''' Function, what will be called.



Revision as of 20:44, 18 September 2017

This function is used to call a function for each elements in the pool.

Syntax

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

Required Arguments

  • Dimension: Int, dimension
  • callingFunction: Function, what will be called.

Example

This example will print the names of players in dimension 0 to the server console. (Dimension 0 is the default dimension)

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

See Also