Pool::length

From RAGE Multiplayer Wiki
Revision as of 08:54, 5 May 2017 by SalwadoR (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function used for get pool elements count.

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