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

***

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

# Interface: BlipMp

A blip: an icon on the map that the server created for this client.

## Remarks

Partial: the blip is shown on the game's map at its position, with its sprite and scale. Its colour, name,
transparency, rotation, short-range flag, draw distance and route are sent by the server but not shown in the game yet.

## Example

```ts
mp.blips.forEach((blip) => mp.console.logInfo(`blip at ${blip.position.x}`));
```

## Properties

### dimension

> `readonly` **dimension**: `number`

The dimension the server set on the blip (a world the blip belongs to).

#### Remarks

Partial: read from the server; the game does not filter blips by dimension yet.

#### Example

```ts
const world = blip.dimension;
```

***

### handle

> `readonly` **handle**: `number`

The game's handle of the blip: a number that scripts can pass on, `0` until the game has made the blip and again
after it is removed.

#### Example

```ts
if (blip.handle !== 0) { }
```

***

### id

> **id**: `number`

The client's id of the blip in `mp.blips` (see [BlipMpPool.at](BlipMpPool.md#at)).

#### Example

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

***

### position

> `readonly` **position**: [`Vector3`](../../common/interfaces/Vector3.md)

The blip's position on the map, in metres.

#### Remarks

Partial: the game moves the blip when the server sends a new position. Assigning this property changes only the
object, not the blip in the game.

#### Example

```ts
const where = blip.position;
```

***

### remoteId

> **remoteId**: `number`

The server's id of the blip.

#### Example

```ts
mp.events.callRemote('blipClicked', blip.remoteId);
```

***

### sprite

> `readonly` **sprite**: `number`

The icon (sprite) the server set on the blip.

#### Remarks

Partial: the game gets the number as the icon's key as it is. RAGE MP sprite numbers are not mapped to VI's icons,
so a RAGE MP number shows the wrong icon or none. The game applies the sprite when the blip appears and again
when the server changes it.

#### Example

```ts
const icon = blip.sprite;
```

***

### type

> `readonly` **type**: `string`

Always `'blip'`.

#### Example

```ts
if (entity.type === 'blip') { }
```

## Methods

### destroy()

> **destroy**(): `void`

Takes the server's blip off this client's map. It comes back when the server sends it again (out of range and back, or a change).

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
blip.destroy();
```

***

### doesExist()

> **doesExist**(): `boolean`

Whether the blip is on this client's map: it has come from the server and no script destroyed it.

#### Returns

`boolean`

True while it is on the map.

#### Example

```ts
if (blip.doesExist()) { }
```

***

### getColour()

> **getColour**(): `number`

The blip's colour as it was last set, as a VI colour key.

#### Returns

`number`

The colour key, 0 when none.

#### Remarks

The value last set: the game has no call to read it back.

#### Example

```ts
const colour = blip.getColour();
```

***

### getCoords()

> **getCoords**(): `Promise`\<[`Vector3`](../../common/interfaces/Vector3.md)\>

Where the game has the blip.

#### Returns

`Promise`\<[`Vector3`](../../common/interfaces/Vector3.md)\>

A Promise of the position; the server's position when the blip is not on the map.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const at = await blip.getCoords();
```

***

### getSprite()

> **getSprite**(): `number`

The blip's icon as it was last set (by the server or a script), as the key the game takes.

#### Returns

`number`

The sprite key, 0 when none.

#### Remarks

The value last set: the game has no call to read it back.

#### Example

```ts
const icon = blip.getSprite();
```

***

### getVariable()

> **getVariable**\<`T`\>(`key`): `T`

A shared variable the server set on the blip, under this key.

#### Type Parameters

##### T

`T` = `any`

#### Parameters

##### key

`string`

The variable's name.

#### Returns

`T`

The value the server set (any JSON value), or `undefined` when there is no such variable.

#### Example

```ts
const label = blip.getVariable('label');
```

***

### hasVariable()

> **hasVariable**(`key`): `boolean`

Whether the server has set a shared variable under this key on the blip.

#### Parameters

##### key

`string`

The variable's name.

#### Returns

`boolean`

True when the variable exists.

#### Example

```ts
if (blip.hasVariable('label')) { }
```

***

### setColour()

> **setColour**(`color`): `void`

Sets the blip's colour: a VI colour key (`mp.blips.colours` names them); 0 removes it.

#### Parameters

##### color

`number`

A VI colour key. A RAGE MP colour id is refused with a one-time warning (the colour is removed).

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
blip.setColour(mp.blips.colours.amber);
```

***

### setCoords()

> **setCoords**(`position`): `void`

Moves the blip on this client's map.

#### Parameters

##### position

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

The new position, in metres.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game. The server's next position moves it again.

#### Example

```ts
blip.setCoords(new mp.Vector3(100, 200, 30));
```

***

### setNameToPlayerName()

> **setNameToPlayerName**(`player`): `void`

Shows the local player's name on the blip.

#### Parameters

##### player

[`PlayerMp`](../../player/interfaces/PlayerMp.md)

The local player (mp.players.local). The other players are not players of the game: for them nothing happens and a one-time warning is logged.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
blip.setNameToPlayerName(mp.players.local);
```

***

### setPosition()

> **setPosition**(`posX`, `posY`, `posZ`): `void`

Moves the blip on this client's map (the same as setCoords).

#### Parameters

##### posX

`number`

The x, metres.

##### posY

`number`

The y, metres.

##### posZ

`number`

The z, metres.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
blip.setPosition(100, 200, 30);
```

***

### setScale()

> **setScale**(`scale`): `void`

Sets the blip's size on the map.

#### Parameters

##### scale

`number`

1 is the usual size.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
blip.setScale(1.5);
```

***

### setSprite()

> **setSprite**(`spriteId`): `void`

Sets the blip's icon: a VI sprite key, or its name.

#### Parameters

##### spriteId

`number`

A VI sprite key (or name). A RAGE MP sprite number is not translated: it is sent as it is, with a one-time warning.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
blip.setSprite(spriteKey);
```
