SixL server API / world-entities / CheckpointMpPool

Interface: CheckpointMpPool

The pool of checkpoints: mp.checkpoints.

Example

mp.checkpoints.forEach((c) => c.destroy());

Extends

Properties

length

readonly length: number

The number of entities in the pool.

Example

const count = mp.blips.length;

Inherited from

BasicMpPool.length

Methods

at()

at(id): CheckpointMp

Finds an entity by id.

Parameters

id

number

The entity's id.

Returns

CheckpointMp

The entity, or null when there is none.

Example

const blip = mp.blips.at(1);

Inherited from

BasicMpPool.at


exists()

exists(entity): boolean

Whether an entity (or an id) is still in the pool.

Parameters

entity

number | CheckpointMp

An entity or its id.

Returns

boolean

True when it exists.

Example

if (mp.blips.exists(blip)) { }

Inherited from

BasicMpPool.exists


forEach()

forEach(callingFunction): void

Calls a function for every entity.

Parameters

callingFunction

(entity) => void

Called with each entity.

Returns

void

Example

mp.blips.forEach((b) => b.destroy());

Inherited from

BasicMpPool.forEach


forEachFast()

forEachFast(callingFunction): void

Calls a function for every entity; the same as forEach in SixL.

Parameters

callingFunction

(entity) => void

Called with each entity.

Returns

void

Example

mp.blips.forEachFast((b) => b.destroy());

Inherited from

BasicMpPool.forEachFast


new()

new(type, position, radius, options?): CheckpointMp

Creates a checkpoint.

Parameters

type

number

The checkpoint kind.

position

Vector3

Where (metres).

radius

number

The radius, in metres.

options?

Optional: color (an [r, g, b, a] array or { r, g, b, a }; default white), dimension (0), direction, destination and visible (default true).

color?

Array4d

destination?

IVector3

dimension?

number

direction?

IVector3

visible?

boolean

Returns

CheckpointMp

The checkpoint. Its enter and exit are watched from now on.

Remarks

Partial: see CheckpointMp.

Example

const cp = mp.checkpoints.new(1, new mp.Vector3(0, 0, 70), 3, { color: [255, 0, 0, 100] });

toArray()

toArray(): CheckpointMp[]

A snapshot of all entities.

Returns

CheckpointMp[]

A new array; changing it does not change the pool.

Example

const all = mp.blips.toArray();

Inherited from

BasicMpPool.toArray