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

***

[SixL server API](../../README.md) / [sixl](../README.md) / Mp

# Interface: Mp

The server API object. It is the global `mp`, and the same object as `SixL`.

## Remarks

Not implemented, so not declared: the constructors `mp.Player`, `mp.Vehicle`, `mp.Blip` ... (create entities with
the pools: `mp.vehicles.new(...)`), and `mp.game`, which is client only.

## Example

```ts
mp.events.add('playerJoin', (player) => player.outputChatBox('Hello'));
const car = mp.vehicles.new('sultan', new mp.Vector3(0, 0, 70));
```

## Properties

### blips

> **blips**: [`BlipMpPool`](../../world-entities/interfaces/BlipMpPool.md)

The blips (map icons).

#### Example

```ts
const blip = mp.blips.new(1, new mp.Vector3(0, 0, 70));
```

***

### checkpoints

> **checkpoints**: [`CheckpointMpPool`](../../world-entities/interfaces/CheckpointMpPool.md)

The checkpoints.

#### Example

```ts
const cp = mp.checkpoints.new(1, new mp.Vector3(0, 0, 70), 3);
```

***

### colshapes

> **colshapes**: [`ColshapeMpPool`](../../world-entities/interfaces/ColshapeMpPool.md)

The colshapes (trigger volumes).

#### Example

```ts
const zone = mp.colshapes.newSphere(0, 0, 70, 5);
```

***

### config

> **config**: [`ConfigMp`](../../world/interfaces/ConfigMp.md)

The server's settings (read-only), filled before the packages load.

#### Example

```ts
console.log(mp.config.name);
```

***

### dummies

> **dummies**: [`DummyMpPool`](../../world-entities/interfaces/DummyMpPool.md)

The dummy entities.

#### Example

```ts
const quest = mp.dummies.new(7, { stage: 1 });
```

***

### Event

> **Event**: [`EventMpConstructor`](../../events/interfaces/EventMpConstructor.md)

The constructor of event handles: `new mp.Event(name, handler)`.

#### Example

```ts
const ev = new mp.Event('playerJoin', (player) => { });
```

***

### events

> **events**: [`EventMpPool`](../../events/interfaces/EventMpPool.md)

The event registry.

#### Example

```ts
mp.events.add('playerChat', (player, text) => { });
```

***

### labels

> **labels**: [`TextLabelMpPool`](../../world-entities/interfaces/TextLabelMpPool.md)

The text labels.

#### Example

```ts
const label = mp.labels.new('Hello', new mp.Vector3(0, 0, 71));
```

***

### markers

> **markers**: [`MarkerMpPool`](../../world-entities/interfaces/MarkerMpPool.md)

The markers.

#### Example

```ts
const marker = mp.markers.new(1, new mp.Vector3(0, 0, 70), 2);
```

***

### network

> **network**: [`NetworkMp`](../../world/interfaces/NetworkMp.md)

Packet batching (does nothing in SixL).

#### Example

```ts
mp.network.startBatch();
```

***

### objects

> **objects**: [`ObjectMpPool`](../../world-entities/interfaces/ObjectMpPool.md)

The objects (props).

#### Example

```ts
const prop = mp.objects.new('0x<hash>', new mp.Vector3(0, 0, 70));
```

***

### peds

> **peds**: [`PedMpPool`](../../world-entities/interfaces/PedMpPool.md)

The peds (NPCs).

#### Example

```ts
const ped = mp.peds.new('mp_m_freemode_01', new mp.Vector3(0, 0, 70));
```

***

### players

> **players**: [`PlayerMpPool`](../../player/interfaces/PlayerMpPool.md)

The players.

#### Example

```ts
mp.players.forEach((p) => p.notify('hi'));
```

***

### Vector3

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

The constructor of 3D vectors: `new mp.Vector3(x, y, z)`.

#### Example

```ts
const pos = new mp.Vector3(0, 0, 70);
```

***

### vehicles

> **vehicles**: [`VehicleMpPool`](../../vehicle/interfaces/VehicleMpPool.md)

The vehicles.

#### Example

```ts
const car = mp.vehicles.new('sultan', new mp.Vector3(0, 0, 70));
```

***

### world

> **world**: [`WorldMp`](../../world/interfaces/WorldMp.md)

The world: weather, time, traffic lights, IPLs.

#### Example

```ts
mp.world.time.set(12, 0, 0);
```

## Methods

### joaat()

#### Call Signature

> **joaat**(`str`): `number`

The Jenkins one-at-a-time hash of a string (case-insensitive), as the game uses for names.

##### Parameters

###### str

`string`

The string, e.g. a model or weapon name.

##### Returns

`number`

The unsigned 32-bit hash.

##### Remarks

SixL remembers every hash it computes, so
`mp.vehicles.new(mp.joaat('sultan'), ...)` works: the hash is turned back into the name for the clients. VI uses
64-bit model keys and its own names: a 32-bit hash of a GTA V name does not select a VI model.

##### Example

```ts
const hash = mp.joaat('sultan');
```

#### Call Signature

> **joaat**(`strs`): `number`[]

The hashes of several strings, in the same order.

##### Parameters

###### strs

`string`[]

The strings.

##### Returns

`number`[]

One unsigned 32-bit hash for each string.

##### Example

```ts
const [a, b] = mp.joaat(['sultan', 'adder']);
```
