Pool::toArray

From RAGE Multiplayer Wiki
Revision as of 02:07, 25 April 2021 by MrPancakers2 (talk | contribs)

Shared
Function

 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

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