Pool::getClosestInDimension
Server-Side Function
JavaScript |
---|
Gets the closest set of entities to a position in the defined dimension.
JavaScript Syntax
Syntax
mp.pool.getClosestInDimension(position, dimension[, numberOfEntities])
Required Arguments
- *position: Vector3
- *dimension: Int
- numberOfEntities: Int
Example
Server-Side
mp.events.addCommand('closest', (player) => { let closest = mp.vehicles.getClosestInDimension(player.position, 0, 3); player.outputChatBox(`The three closest vehicles: ${closest}`) });
See Also
- Functions
- Properties
- Arrays