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

***

[SixL client API](../../README.md) / [world-entities](../README.md) / MarkerMpPool

# Interface: MarkerMpPool

The pool of markers: `mp.markers`. It holds the markers the server has sent to this client, and the ones a script made.

## Example

```ts
mp.markers.forEach((marker) => mp.console.logInfo(String(marker.visible)));
```

## Constructors

### Constructor

> **new MarkerMpPool**(`type`, `position`, `scale`, `options?`): [`MarkerMp`](MarkerMp.md)

Makes a marker, drawn by the overlay until it is destroyed.

#### Parameters

##### type

`number`

The shape (the marker types of RAGE MP), an integer.

##### position

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

Where it stands, metres.

##### scale

`number`

Its size, as a multiple of its normal size.

##### options?

`color` (`[r, g, b, a]`, white by default), `direction` and `rotation` (vectors, zero by default),
`visible` (true by default), `bobUpAndDown` (false by default) and `dimension`.

###### bobUpAndDown?

`boolean`

###### color?

[`Array4d`](../../common/type-aliases/Array4d.md)

###### dimension?

`number`

###### direction?

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

###### rotation?

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

###### visible?

`boolean`

#### Returns

[`MarkerMp`](MarkerMp.md)

The new marker.

#### Remarks

It is not streamed: no stream-in event is raised for it.

#### Example

```ts
const marker = mp.markers.new(1, new mp.Vector3(10, 20, 30), 2, { color: [255, 0, 0, 200] });
```

## Properties

### length

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

The number of markers the client holds now.

#### Example

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

## Methods

### at()

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

The marker with this client id, or `undefined`.

#### Parameters

##### id

`number`

The client's own number for the marker (from 1, reused after a marker is removed). It is not the server's id.

#### Returns

[`MarkerMp`](MarkerMp.md)

The marker, or `undefined` when there is none with that id.

#### Example

```ts
const marker = mp.markers.at(1);
```

***

### exists()

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

Whether a marker is still held by this client.

#### Parameters

##### entity

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

A marker, or the client id of one (the id of [MarkerMpPool.at](#at)).

#### Returns

`boolean`

True while the marker is held; false once the server has removed it from this client, or a script has destroyed it.

#### Example

```ts
if (mp.markers.exists(marker)) { }
```

***

### forEach()

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

Calls a function for every marker held by this client.

#### Parameters

##### callingFunction

(`entity`) => `void`

Called with each marker.

#### Returns

`void`

#### Example

```ts
mp.markers.forEach((marker) => mp.console.logInfo(String(marker.scale)));
```

***

### toArray()

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

The markers held by this client, as an array.

#### Returns

[`MarkerMp`](MarkerMp.md)[]

A new array of the markers at the time of the call.

#### Example

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