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

***

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

# Interface: BlipMp

A blip: an icon on the map.

## Remarks

Partial: the server keeps the blip, streams it to the clients (by dimension; blips show anywhere on the map)
and sends every property change, but the game does not show name and route yet. Colours and sprites are VI values:
a colour is a VI modifier key (use the named constants of `mp.blips.colours`), a sprite is a VI sprite key.
RAGE MP / GTA V colour and sprite ids are not translated: the client logs a one-time warning and ignores a small
colour id.

## Example

```ts
const blip = mp.blips.new(1, new mp.Vector3(0, 0, 70), { name: 'Shop', shortRange: true });
```

## Extends

- [`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md)

## Properties

### alpha

> **alpha**: `number`

The opacity, 0..255 (default 255).

#### Remarks

Partial: sent to the clients; the game does not show it yet.

#### Example

```ts
blip.alpha = 200;
```

***

### color

> **color**: `number`

The blip's colour, a VI blip modifier key (default 0: no colour modifier).

#### Remarks

Use a named VI colour, `mp.blips.colours.amber`, or a VI modifier key (a 32-bit hash, 0x10000 or more).
A new colour replaces the previous one. A RAGE MP colour id (a small number) is not translated: the client warns
once and applies no colour.

#### Example

```ts
blip.color = mp.blips.colours.amber;
```

***

### data

> **data**: `any`

The shared variables as properties: `entity.data.key` reads, `entity.data.key = value` sets.

#### Remarks

A view over [BaseEntityMp.getVariable](../../entity/interfaces/BaseEntityMp.md#getvariable) / [BaseEntityMp.setVariable](../../entity/interfaces/BaseEntityMp.md#setvariable): setting a key sends it
to clients exactly like `setVariable`.

#### Example

```ts
player.data.cash = 100;
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`data`](../../entity/interfaces/PositionedEntityMp.md#data)

***

### dimension

> **dimension**: `number`

The dimension the entity lives in: players see and stream only entities of their own dimension.

#### Remarks

Dimension 0 is the default world. For players it is applied at once and the streaming is recomputed;
for other entities it is picked up on the next tick. For [PlayerMp.isStreamed](../../player/interfaces/PlayerMp.md#isstreamed) dimension 0 counts as
global; for vehicles, peds and objects (`isStreamed`) the dimensions must be equal.

#### Example

```ts
player.dimension = 5;
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`dimension`](../../entity/interfaces/PositionedEntityMp.md#dimension)

***

### drawDistance

> **drawDistance**: `number`

The distance, in metres, within which the blip is drawn; 0 = always.

#### Remarks

Partial: sent to the clients; the game does not show it yet.

#### Example

```ts
blip.drawDistance = 500;
```

***

### id

> `readonly` **id**: `number`

The entity's id, unique within its pool (`mp.players`, `mp.vehicles` …).

#### Remarks

Ids are server-side and start at 0 or 1 per pool, so two entities of different kinds can share one.
The client's `remoteId` is this same number.

#### Example

```ts
const vehicle = mp.vehicles.at(vehicleId);
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`id`](../../entity/interfaces/PositionedEntityMp.md#id)

***

### name

> **name**: `string`

The name shown in the map legend. Defaults to `'NULL'`.

#### Remarks

Partial: sent to the clients; the game does not show it yet.

#### Example

```ts
blip.name = 'Garage';
```

***

### position

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

The entity's position in metres.

#### Remarks

Reading returns the script host's copy. Setting moves the entity: for players, vehicles, peds and
objects the new position is sent to the server (for peds the new position does not reach the clients yet).
A blip, marker, label or checkpoint streams the new position to the players.

#### Example

```ts
player.position = new mp.Vector3(0, 0, 70);
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`position`](../../entity/interfaces/PositionedEntityMp.md#position)

***

### rotation

> **rotation**: `number`

The icon's rotation, in degrees (default 0).

#### Remarks

Partial: sent to the clients; the game does not show it yet.

#### Example

```ts
blip.rotation = 90;
```

***

### scale

> **scale**: `number`

The icon scale (1 = normal).

#### Remarks

Partial: sent to the clients; the game does not show it yet.

#### Example

```ts
blip.scale = 0.8;
```

***

### shortRange

> **shortRange**: `boolean`

Whether the blip shows only when the player is near it.

#### Remarks

Partial: sent to the clients; the client decides how to apply it.

#### Example

```ts
blip.shortRange = true;
```

***

### sprite

> **sprite**: `number`

The sprite (icon) number.

#### Remarks

A VI sprite key. A small GTA V sprite id is not translated: the client warns once and passes it on as is.

#### Example

```ts
blip.sprite = 0x607ab926;
```

***

### type

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

Always `'blip'`.

#### Example

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

## Methods

### destroy()

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

Removes the entity.

#### Returns

`void`

#### Remarks

For vehicles, peds and objects the entity is gone from its pool the moment `destroy()` returns
(`exists` is false at once) and `entityDestroyed` follows. Players cannot be destroyed: use `kick()`.

#### Example

```ts
vehicle.destroy();
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`destroy`](../../entity/interfaces/PositionedEntityMp.md#destroy)

***

### dist()

> **dist**(`position`): `number`

The distance from the entity to a point or another entity.

#### Parameters

##### position

[`IVector3`](../../common/interfaces/IVector3.md) \| \{ `position`: [`IVector3`](../../common/interfaces/IVector3.md); \}

A point (anything with `x`, `y`, `z`, metres) or an entity (anything with `position`).

#### Returns

`number`

The 3D distance in metres.

#### Example

```ts
if (player.dist(shop.position) < 3) { }
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`dist`](../../entity/interfaces/PositionedEntityMp.md#dist)

***

### distSquared()

> **distSquared**(`position`): `number`

The squared distance (no square root: cheaper for comparisons).

#### Parameters

##### position

[`IVector3`](../../common/interfaces/IVector3.md) \| \{ `position`: [`IVector3`](../../common/interfaces/IVector3.md); \}

A point (anything with `x`, `y`, `z`, metres) or an entity (anything with `position`).

#### Returns

`number`

The squared 3D distance, metres squared.

#### Example

```ts
if (player.distSquared(point) < 25) { }
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`distSquared`](../../entity/interfaces/PositionedEntityMp.md#distsquared)

***

### getVariable()

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

Reads a shared variable (set by [BaseEntityMp.setVariable](../../entity/interfaces/BaseEntityMp.md#setvariable)).

#### Type Parameters

##### T

`T` = `any`

#### Parameters

##### name

`string`

The variable's key.

#### Returns

`T`

The value, or `undefined` when it was never set. Read from the script host's own copy: no round trip.

#### Example

```ts
const job = player.getVariable('job');
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`getVariable`](../../entity/interfaces/PositionedEntityMp.md#getvariable)

***

### routeFor()

> **routeFor**(`players`): `void`

Draws a route to the blip for some players.

#### Parameters

##### players

[`PlayerTargets`](../type-aliases/PlayerTargets.md)

A player, a player id, or an array of them.

#### Returns

`void`

#### Remarks

Partial: the list goes to the clients (`routedFor`); the game does not draw the route yet. RAGE MP's
colour and scale arguments are not supported.

#### Example

```ts
blip.routeFor(player);
```

***

### setVariable()

> **setVariable**(`name`, `value`): `void`

Sets a shared variable on the entity.

#### Parameters

##### name

`string`

The variable's key.

##### value

`any`

Any JSON-serialisable value.

#### Returns

`void`

#### Remarks

The script's own copy changes at once. Players, vehicles, peds and objects also send it to the
clients that have the entity streamed in (with the size and rate limits of the server; a refused change is
logged by the script host and the local copy stays). Colshapes and dummies keep it on the server only.
Blips, markers, labels and checkpoints send it with their other data.

#### Example

```ts
vehicle.setVariable('fuel', 42);
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`setVariable`](../../entity/interfaces/PositionedEntityMp.md#setvariable)

***

### setVariables()

> **setVariables**(`values`): `void`

Sets several shared variables at once; the same as calling [BaseEntityMp.setVariable](../../entity/interfaces/BaseEntityMp.md#setvariable) for each key.

#### Parameters

##### values

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

An object of key to value.

#### Returns

`void`

#### Example

```ts
player.setVariables({ job: 'taxi', level: 3 });
```

#### Inherited from

[`PositionedEntityMp`](../../entity/interfaces/PositionedEntityMp.md).[`setVariables`](../../entity/interfaces/PositionedEntityMp.md#setvariables)

***

### unrouteFor()

> **unrouteFor**(`players`): `void`

Removes the route to the blip for some players.

#### Parameters

##### players

[`PlayerTargets`](../type-aliases/PlayerTargets.md)

A player, a player id, or an array of them.

#### Returns

`void`

#### Remarks

Partial: as [BlipMp.routeFor](#routefor).

#### Example

```ts
blip.unrouteFor(player);
```
