Pool::forEachInDimension
Jump to navigation
Jump to search
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
- Functions
- Properties
- Arrays