Pool::toArray

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Shared
Function

Js.png JavaScript


This function converts a pool to an array. If you don't need to create a new array every time, use Pool::toArrayFast.

JavaScript Syntax
Jslogo.png

Syntax

mp.pool.toArray();

Example

Server-Side
const onlinePlayers = mp.players.toArray();
if(onlinePlayers.every((player) => { return player.isAiming; } ))
    console.log("Everyone is aiming.");


See Also