[**SixL server API**](../../README.md)

***

[SixL server API](../../README.md) / [world-entities](../README.md) / CheckpointMpPool

# Interface: CheckpointMpPool

The pool of checkpoints: `mp.checkpoints`.

## Example

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

## Extends

- [`BasicMpPool`](../../entity/interfaces/BasicMpPool.md)\<[`CheckpointMp`](CheckpointMp.md)\>

## Properties

### length

> `readonly` **length**: `number`

The number of entities in the pool.

#### Example

```ts
const count = mp.blips.length;
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`length`](../../entity/interfaces/BasicMpPool.md#length)

## Methods

### at()

> **at**(`id`): [`CheckpointMp`](CheckpointMp.md)

Finds an entity by id.

#### Parameters

##### id

`number`

The entity's id.

#### Returns

[`CheckpointMp`](CheckpointMp.md)

The entity, or `null` when there is none.

#### Example

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

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`at`](../../entity/interfaces/BasicMpPool.md#at)

***

### exists()

> **exists**(`entity`): `boolean`

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

#### Parameters

##### entity

`number` \| [`CheckpointMp`](CheckpointMp.md)

An entity or its id.

#### Returns

`boolean`

True when it exists.

#### Example

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

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`exists`](../../entity/interfaces/BasicMpPool.md#exists)

***

### forEach()

> **forEach**(`callingFunction`): `void`

Calls a function for every entity.

#### Parameters

##### callingFunction

(`entity`) => `void`

Called with each entity.

#### Returns

`void`

#### Example

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

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`forEach`](../../entity/interfaces/BasicMpPool.md#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

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

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`forEachFast`](../../entity/interfaces/BasicMpPool.md#foreachfast)

***

### new()

> **new**(`type`, `position`, `radius`, `options?`): [`CheckpointMp`](CheckpointMp.md)

Creates a checkpoint.

#### Parameters

##### type

`number`

The checkpoint kind.

##### position

[`Vector3`](../../common/interfaces/Vector3.md)

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`](../../common/type-aliases/Array4d.md)

###### destination?

[`IVector3`](../../common/interfaces/IVector3.md)

###### dimension?

`number`

###### direction?

[`IVector3`](../../common/interfaces/IVector3.md)

###### visible?

`boolean`

#### Returns

[`CheckpointMp`](CheckpointMp.md)

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

#### Remarks

Partial: see [CheckpointMp](CheckpointMp.md).

#### Example

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

***

### toArray()

> **toArray**(): [`CheckpointMp`](CheckpointMp.md)[]

A snapshot of all entities.

#### Returns

[`CheckpointMp`](CheckpointMp.md)[]

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

#### Example

```ts
const all = mp.blips.toArray();
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`toArray`](../../entity/interfaces/BasicMpPool.md#toarray)
