Pool::toArray: Difference between revisions
m (Replaced HTML with template) |
m (Cleaned up the example code's grammar, punctuation, and capitalization.) |
||
| Line 11: | Line 11: | ||
var suchJavascript = mp.players.toArray(); | var suchJavascript = mp.players.toArray(); | ||
if(suchJavascript.every((player) => { return player.isAiming; } )) | if(suchJavascript.every((player) => { return player.isAiming; } )) | ||
console.log(" | console.log("Everyone is aiming."); | ||
</pre> | </pre> | ||
}} | }} | ||
Revision as of 22:05, 27 October 2020
This function converts a pool to a JavaScript array.
Syntax
pool.toArray();
Example
Server-Side
var suchJavascript = mp.players.toArray();
if(suchJavascript.every((player) => { return player.isAiming; } ))
console.log("Everyone is aiming.");