Pool::length: Difference between revisions
(Created page with "This function used for get pool elements count. ==Syntax== <syntaxhighlight lang="javascript"> int pool.length; </syntaxhighlight> ==Example== That's example will return v...") |
No edit summary |
||
| Line 1: | Line 1: | ||
This function used for get pool elements count. | This function used for get pool elements count. | ||
'''Note: this property is read-only.''' | |||
==Syntax== | ==Syntax== | ||
Revision as of 09:26, 5 May 2017
This function used for get pool elements count.
Note: this property is read-only.
Syntax
int pool.length;
Example
That's example will return vehicles and players count.
let getStuffCount = () => {
return [mp.players.length, mp.vehicles.length];
};
let [players, vehicles] = getStuffCount();
console.log(`Server have ${vehicles} vehicles and ${players} players.`)
See Also
- Functions
- Properties
- Arrays