Pool::length

From RAGE Multiplayer Wiki
Revision as of 09:59, 20 September 2017 by CurtisVL (talk | contribs) (Fixed bad English, updated example border)

This property is used to get the element count of a pool.

Note: this property is read-only.

Syntax

int pool.length;

Example

This example will return vehicles and players count.

Server-Side
let getStuffCount = () => {
	return [mp.players.length, mp.vehicles.length];
};

let [players, vehicles] = getStuffCount();
console.log(`Server have ${vehicles} vehicles and ${players} players.`)

See Also