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

***

[SixL client API](../../README.md) / [vehicle](../README.md) / VehicleMp

# Interface: VehicleMp

A vehicle the server streamed in to this client.

## Remarks

Every member works on the vehicle as the game shows it: a call uses the vehicle's game handle. While the game has
not shown the vehicle yet (`handle` is 0), a call is refused: it returns a rejected Promise, setters too.
Getters are asynchronous: they return a Promise of the game's answer. Setters return nothing and take effect on a
later game frame. Values are the game's own, without conversion, unless a member says otherwise. Partial: each
member is a thin call to the game for this vehicle; an index or a unit that the game does not state here is passed
on as it is, and such members say so in their own remarks.

## Example

```ts
mp.vehicles.forEach((car) => car.setEngineOn(true, true, false));
```

## Extends

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

## Properties

### alpha

> **alpha**: `number`

The entity's opacity as this script last set it: 0 (invisible) to 255 (opaque).

#### Remarks

Synchronous, and the same on every entity kind (the local player, other players, peds, vehicles,
objects). It is the value the script gave `setAlpha` or this property, 255 after `resetAlpha` and before the first
set; it is not read back from the game (`getAlpha` does that, asynchronously). Writing it is `setAlpha`. An entity
the game does not show yet (handle 0) keeps its old value.

#### Example

```ts
vehicle.alpha = 128;
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`alpha`](../../entity/interfaces/EntityMp.md#alpha)

***

### data

> **data**: `object`

The entity's shared variables as an object: the same values [EntityMp.getVariable](../../entity/interfaces/EntityMp.md#getvariable) reads.

#### Index Signature

\[`key`: `string`\]: `any`

#### Remarks

Works for players, peds, vehicles and objects. `entity.data.job` is `getVariable('job')`; `'job' in
entity.data` is `hasVariable('job')`; `Object.keys(entity.data)` lists the script's variables (the server's
built-in `sixl:` state is not listed, but can be read by its key). Writing a key, or deleting one, changes this
client's copy only: the server is not told, and its next change to the key replaces the value.

#### Example

```ts
const job = player.data.job;
```

#### Inherited from

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

***

### dimension

> **dimension**: `number`

The dimension the entity is in.

#### Remarks

Works for players, peds, vehicles and objects. The server sends the dimension with the entity's data
and again whenever a script changes it; until it does, the value is 0. Setting it changes this client's copy only
(the server is not told) until the server's next change. When the entity streams out, the value is forgotten.

#### Example

```ts
if (vehicle.dimension === player.dimension) { }
```

#### Inherited from

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

***

### handle

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

The number that stands for this entity in `mp.game` calls (the entity can also be passed itself).

#### Remarks

It is 0 while the game does not show the entity: a vehicle the server has streamed in but the game has
not made yet, or a player who is streamed in without a puppet (see `isShown`). Questions asked of an entity with
handle 0 are rejected, except [EntityMp.doesExist](../../entity/interfaces/EntityMp.md#doesexist), which answers false. Streamed peds and objects get their
handle when they stream in; a vehicle's can come later, and it can change when the entity is made again.

#### Example

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

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`handle`](../../entity/interfaces/EntityMp.md#handle)

***

### id

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

The entity's id in its own pool on this client (`mp.players`, `mp.peds` ...).

#### Remarks

For players the local player is 0 and the other players get 1, 2, ... while they stay in range.
Peds, vehicles and objects count from 1 in their own pools. The id is stable as long as the entity is streamed in.

#### Example

```ts
const slot = player.id;
```

#### Inherited from

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

***

### isPositionFrozen

> **isPositionFrozen**: `boolean`

Whether the vehicle is frozen in place.

#### Remarks

Partial: the value a script last set here (false until then), not read back from the game; setting it freezes or unfreezes the vehicle. On a server vehicle the server's state may put it back: the change is made in this client's game only. Not yet confirmed in the game.

#### Example

```ts
vehicle.isPositionFrozen = true;
```

***

### model

> `readonly` **model**: `number`

The entity's model, as the server gave it when it made the entity.

#### Remarks

A number: the hash of the model name the server script used, or the key it passed. Models are the
game's own keys; names of the older game do not resolve. Only a copy: changing it does not change the model in the
game. Players have the model the server's script set (`player.model = ...`), hashed the same way, and 0 until it set
one; the model the game shows: [EntityMp.getModel](../../entity/interfaces/EntityMp.md#getmodel).

#### Example

```ts
const model = vehicle.model;
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`model`](../../entity/interfaces/EntityMp.md#model)

***

### position

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

The entity's position in the world, in metres.

#### Remarks

Reading gives the position from the latest update, which may lag the game by a tick: the local player is
updated every frame, a streamed-in player follows the server's sync, and a ped, vehicle or object is where the server
put it, or where [EntityMp.getCoords](../../entity/interfaces/EntityMp.md#getcoords) last found it.
Setting it teleports the local player only (`mp.players.local`): the heading stays, and a vehicle the player is in
moves with them. Setting it on a remote player throws an error, because the server places remote players. A remote
player with no puppet in the game (`isShown` false) is not checked: setting its position moves the local player, so
do not do it.

#### Example

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

#### Inherited from

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

***

### remoteId

> `readonly` **remoteId**: `number`

The entity's id on the server: the same number the server uses for it.

#### Remarks

For the local player it is the id the server sent with the player's own data; it is -1 until then.
Peds, vehicles and objects have the id the server gave them when it made them.

#### Example

```ts
const serverId = player.remoteId;
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`remoteId`](../../entity/interfaces/EntityMp.md#remoteid)

***

### rotation

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

The entity's rotation in the world, in degrees: x the pitch, y the roll, z the yaw.

#### Remarks

The last known value, which may lag the game by a tick. A player has only its heading (as the yaw, pitch
and roll are 0); a streamed ped or vehicle has the yaw of the heading the server put it at; a server object has the
rotation the server gave it. Reading the entity from the game ([EntityMp.getRotation](../../entity/interfaces/EntityMp.md#getrotation)) refreshes the copy of a
streamed ped, vehicle or object. Setting it on a ped, vehicle or object only changes this copy; setting it on a
player throws an error.

#### Example

```ts
const yaw = mp.players.local.rotation.z;
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`rotation`](../../entity/interfaces/EntityMp.md#rotation)

***

### type

> `readonly` **type**: `"object"` \| `"player"` \| `"ped"` \| `"vehicle"`

The kind of entity.

#### Remarks

`'player'` for the local player and the other players, `'ped'` for server peds, `'vehicle'` for server
vehicles and `'object'` for server objects. It is fixed when the entity is made.

#### Example

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

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`type`](../../entity/interfaces/EntityMp.md#type)

## Methods

### addUpsidedownCheck()

> **addUpsidedownCheck**(): `void`

Starts watching whether the vehicle is upside down.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
vehicle.addUpsidedownCheck();
```

***

### applyForceTo()

> **applyForceTo**(`forceType`, `x`, `y`, `z`, `xRot`, `yRot`, `zRot`, `boneIndex`, `isRel`, `p9`, `highForce`, `p11`, `p12`): `void`

Pushes the entity.

#### Parameters

##### forceType

`number`

The kind of force the game applies (0 to 5).

##### x

`number`

Force along x.

##### y

`number`

Force along y.

##### z

`number`

Force along z.

##### xRot

`number`

Offset of the point of application along x; not used, see the remarks.

##### yRot

`number`

Offset along y; not used.

##### zRot

`number`

Offset along z; not used.

##### boneIndex

`number`

The bone to push; not used.

##### isRel

`number`

Whether the vector is relative to the entity's own axes instead of the world's: 0 is no, any other number yes.

##### p9

`boolean`

Not used.

##### highForce

`boolean`

Whether the force is scaled by the entity's mass.

##### p11

`boolean`

Not used.

##### p12

`boolean`

Whether the force also applies to the entities attached to it.

#### Returns

`void`

#### Remarks

The force always acts on the centre of mass: the point of application and the bone are ignored, so the push
never spins the entity. A change to this client's game copy of the entity only.

#### Example

```ts
vehicle.applyForceTo(1, 0, 0, 5, 0, 0, 0, 0, 0, true, true, false, false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`applyForceTo`](../../entity/interfaces/EntityMp.md#applyforceto)

***

### applyForceToCenterOfMass()

> **applyForceToCenterOfMass**(`forceType`, `x`, `y`, `z`, `p4`, `isRel`, `highForce`, `p7`): `void`

Pushes the entity with a force acting on its centre of mass.

#### Parameters

##### forceType

`number`

The kind of force the game applies (0 to 5): how the vector is read, as an impulse or a continuous force.

##### x

`number`

Force along x.

##### y

`number`

Force along y.

##### z

`number`

Force along z.

##### p4

`boolean`

Passed to the game as it is.

##### isRel

`boolean`

Whether the vector is relative to the entity's own axes instead of the world's.

##### highForce

`boolean`

Whether the force is scaled by the entity's mass.

##### p7

`boolean`

Whether the force also applies to the entities attached to it.

#### Returns

`void`

#### Remarks

A change to this client's game copy of the entity: a server entity is pushed on this client only, and the
server's next sync overrides it.

#### Example

```ts
vehicle.applyForceToCenterOfMass(1, 0, 0, 5, false, true, true, false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`applyForceToCenterOfMass`](../../entity/interfaces/EntityMp.md#applyforcetocenterofmass)

***

### attachTo()

> **attachTo**(`entity`, `boneIndex`, `xPos`, `yPos`, `zPos`, `xRot`, `yRot`, `zRot`, `p8`, `useSoftPinning`, `collision`, `isPed`, `vertexIndex`, `fixedRot`): `void`

Attaches this entity to another one, so that it follows it.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The entity to attach to: an entity object or its handle.

##### boneIndex

`number`

The bone of the target to hold on to; -1 for the entity itself.

##### xPos

`number`

Offset from the target along x, in metres.

##### yPos

`number`

Offset along y, in metres.

##### zPos

`number`

Offset along z, in metres.

##### xRot

`number`

Rotation about x relative to the target, in degrees.

##### yRot

`number`

Rotation about y, in degrees.

##### zRot

`number`

Rotation about z, in degrees.

##### p8

`boolean`

The game's flag, passed as is.

##### useSoftPinning

`boolean`

Whether the attachment breaks when the carrier is hit hard.

##### collision

`boolean`

Whether this entity keeps colliding with the world while attached.

##### isPed

`boolean`

Whether this entity is a ped.

##### vertexIndex

`number`

The game's rotation order index; 2 is the usual value.

##### fixedRot

`boolean`

Whether the rotation stays fixed to the target.

#### Returns

`void`

#### Remarks

The attachment is made on this client only: other players do not see it, as in RAGE MP. The entity and
the target must be shown by the game; otherwise the call throws. Undo it with `detach`.

#### Example

```ts
prop.attachTo(vehicle, -1, 0, -1.5, 1, 0, 0, 0, false, false, false, false, 2, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`attachTo`](../../entity/interfaces/EntityMp.md#attachto)

***

### attachToPhysically()

> **attachToPhysically**(`entity`, `boneIndex1`, `boneIndex2`, `xPos1`, `yPos1`, `zPos1`, `xPos2`, `yPos2`, `zPos2`, `xRot`, `yRot`, `zRot`, `breakForce`, `fixedRot`, `p14`, `collision`, `p16`, `p17`): `void`

Attaches this entity to another one with physics, so that it hangs on it and can break loose.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The entity to attach to: an entity object or its handle.

##### boneIndex1

`number`

The bone of this entity; -1 for the entity itself.

##### boneIndex2

`number`

The bone of the target; -1 for the entity itself.

##### xPos1

`number`

Attachment point on this entity along x, in metres.

##### yPos1

`number`

Attachment point on this entity along y, in metres.

##### zPos1

`number`

Attachment point on this entity along z, in metres.

##### xPos2

`number`

Attachment point on the target along x, in metres.

##### yPos2

`number`

Attachment point on the target along y, in metres.

##### zPos2

`number`

Attachment point on the target along z, in metres.

##### xRot

`number`

Rotation about x, in degrees.

##### yRot

`number`

Rotation about y, in degrees.

##### zRot

`number`

Rotation about z, in degrees.

##### breakForce

`number`

The force at which the attachment breaks.

##### fixedRot

`boolean`

Whether the rotation stays fixed.

##### p14

`boolean`

The game's flag, passed as is.

##### collision

`boolean`

Whether the two entities collide with each other.

##### p16

`boolean`

The game's flag, passed as is.

##### p17

`number`

The game's rotation order index, passed as is.

#### Returns

`void`

#### Remarks

Made on this client only, as `attachTo`.

#### Example

```ts
crate.attachToPhysically(truck, -1, -1, 0, 0, 0, 0, -2, 1, 0, 0, 0, 500, true, false, true, false, 2);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`attachToPhysically`](../../entity/interfaces/EntityMp.md#attachtophysically)

***

### attachToTrailer()

> **attachToTrailer**(`trailer`, `radius`): `void`

Attaches the vehicle to a trailer.

#### Parameters

##### trailer

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The trailer (a vehicle or another entity) to attach to.

##### radius

`number`

The radius, as the game takes it (the unit is not stated here).

#### Returns

`void`

#### Example

```ts
truck.attachToTrailer(trailer, 5);
```

***

### clearLastDamage()

> **clearLastDamage**(): `void`

Forgets which entity damaged this one last.

#### Returns

`void`

#### Remarks

Works on every kind of entity. The next `hasBeenDamagedBy*` question starts afresh.

#### Example

```ts
vehicle.clearLastDamage();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`clearLastDamage`](../../entity/interfaces/EntityMp.md#clearlastdamage)

***

### destroy()

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

Does nothing: a client cannot delete a server entity.

#### Returns

`void`

#### Remarks

RAGE MP ignores it on server entities as well. The first call writes one warning to the console. Entities
made by the client come in a later version.

#### Example

```ts
ped.destroy();
```

#### Inherited from

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

***

### detach()

> **detach**(`dynamic`, `collision`): `void`

Detaches the entity from whatever it is attached to.

#### Parameters

##### dynamic

`boolean`

The game's dynamic flag, passed as is.

##### collision

`boolean`

The game's collision flag, passed as is.

#### Returns

`void`

#### Example

```ts
entity.detach(true, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`detach`](../../entity/interfaces/EntityMp.md#detach)

***

### detachFromTrailer()

> **detachFromTrailer**(): `void`

Detaches the vehicle from its trailer.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.detachFromTrailer();
```

***

### dist()

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

The straight-line distance from the entity to a point.

#### Parameters

##### position

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

The point (metres).

#### Returns

`number`

The 3D distance in metres.

#### Remarks

Answered at once from the entity's last known `position` (for a vehicle, ped or object the place the
server put it; for a player the latest update). It works the same on every kind of entity.

#### Example

```ts
const metres = vehicle.dist(mp.players.local.position);
```

#### Inherited from

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

***

### distSquared()

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

The square of the distance from the entity to a point; cheaper than `dist` when only comparing distances.

#### Parameters

##### position

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

The point (metres).

#### Returns

`number`

The squared 3D distance in square metres.

#### Remarks

Answered at once from the entity's last known `position`.

#### Example

```ts
const near = ped.distSquared(mp.players.local.position) < 25;
```

#### Inherited from

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

***

### doesBelongToThisScript()

> **doesBelongToThisScript**(`deadcheck?`): `Promise`\<`boolean`\>

Whether the entity belongs to this client's script.

#### Parameters

##### deadcheck?

`boolean`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const ours = await entity.doesBelongToThisScript();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`doesBelongToThisScript`](../../entity/interfaces/EntityMp.md#doesbelongtothisscript)

***

### doesExist()

> **doesExist**(): `Promise`\<`boolean`\>

Whether the entity still exists in the game.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false. It is false, not a rejection, while the entity's handle is 0 (not shown yet).

#### Example

```ts
if (!(await entity.doesExist())) { }
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`doesExist`](../../entity/interfaces/EntityMp.md#doesexist)

***

### doesHaveDrawable()

> **doesHaveDrawable**(): `Promise`\<`boolean`\>

Whether the entity has a drawable (something to show on screen).

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const visible = await entity.doesHaveDrawable();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`doesHaveDrawable`](../../entity/interfaces/EntityMp.md#doeshavedrawable)

***

### doesHavePhysics()

> **doesHavePhysics**(): `Promise`\<`boolean`\>

Whether the entity has physics (is simulated).

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const simulated = await entity.doesHavePhysics();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`doesHavePhysics`](../../entity/interfaces/EntityMp.md#doeshavephysics)

***

### doesHaveRoof()

> **doesHaveRoof**(): `Promise`\<`boolean`\>

Whether the vehicle has a roof.

#### Returns

`Promise`\<`boolean`\>

A promise of true when it has.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.doesHaveRoof()) { }
```

***

### doesHaveStuckCheck()

> **doesHaveStuckCheck**(): `Promise`\<`number`\>

Whether the game watches the vehicle for being stuck, as a number.

#### Returns

`Promise`\<`number`\>

A promise of 1 when it does, else 0.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.doesHaveStuckCheck()) { }
```

***

### doesHaveStuckVehicleCheck()

> **doesHaveStuckVehicleCheck**(): `Promise`\<`boolean`\>

Whether the game watches the vehicle for being stuck.

#### Returns

`Promise`\<`boolean`\>

A promise of true when it does.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.doesHaveStuckVehicleCheck()) { }
```

***

### fixWindow()

> **fixWindow**(`index`): `void`

Repairs a window of the vehicle.

#### Parameters

##### index

`number`

The window, as the game numbers it.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.fixWindow(0);
```

***

### forceAiAndAnimationUpdate()

> **forceAiAndAnimationUpdate**(): `void`

Makes the game update the entity's AI and animation at once, in this frame.

#### Returns

`void`

#### Example

```ts
entity.forceAiAndAnimationUpdate();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`forceAiAndAnimationUpdate`](../../entity/interfaces/EntityMp.md#forceaiandanimationupdate)

***

### forceStreamingUpdate()

> **forceStreamingUpdate**(): `void`

Asks the game to stream the entity in at once.

#### Returns

`void`

#### Remarks

Accepted for RAGE MP compatibility: SixL streams entities by the server's range and the client has
nothing to force, so the call does nothing.

#### Example

```ts
vehicle.forceStreamingUpdate();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`forceStreamingUpdate`](../../entity/interfaces/EntityMp.md#forcestreamingupdate)

***

### freezePosition()

> **freezePosition**(`toggle`): `void`

Freezes or unfreezes the entity's position.

#### Parameters

##### toggle

`boolean`

True to freeze, false to let it move.

#### Returns

`void`

#### Remarks

Changes the game's copy of the entity on this client only.

#### Example

```ts
player.freezePosition(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`freezePosition`](../../entity/interfaces/EntityMp.md#freezeposition)

***

### getAcceleration()

> **getAcceleration**(): `Promise`\<`number`\>

The vehicle's acceleration, as the game reports it.

#### Returns

`Promise`\<`number`\>

A Promise of the value.

#### Remarks

Asynchronous. The game's unit is not stated here: the value is returned without conversion.

#### Example

```ts
const acc = await car.getAcceleration();
```

***

### getAlpha()

> **getAlpha**(): `Promise`\<`number`\>

The entity's opacity.

#### Returns

`Promise`\<`number`\>

A Promise of the alpha: 0 (invisible) to 255 (opaque).

#### Remarks

Asynchronous: the value is read from the game when the Promise is awaited. Works on every entity kind; a
vehicle the game does not show yet (handle 0) rejects. The `alpha` property is the synchronous copy of what a
script set.

#### Example

```ts
const alpha = await player.getAlpha();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getAlpha`](../../entity/interfaces/EntityMp.md#getalpha)

***

### getAnimCurrentTime()

> **getAnimCurrentTime**(`dictionary`, `name`): `Promise`\<`number`\>

The current time of an animation that plays on the entity.

#### Parameters

##### dictionary

`string` \| `number`

The animation dictionary's name (hashed when a string) or its hash.

##### name

`string` \| `number`

The animation's name (hashed when a string) or its hash.

#### Returns

`Promise`\<`number`\>

A Promise of the time, as the game reports it (no conversion).

#### Example

```ts
const t = await entity.getAnimCurrentTime('move_m@', 'walk');
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getAnimCurrentTime`](../../entity/interfaces/EntityMp.md#getanimcurrenttime)

***

### getAttachedTo()

> **getAttachedTo**(): `Promise`\<[`EntityMp`](../../entity/interfaces/EntityMp.md)\>

The entity this one is attached to.

#### Returns

`Promise`\<[`EntityMp`](../../entity/interfaces/EntityMp.md)\>

A Promise of the entity, or undefined when this entity is not attached.

#### Remarks

Only entities the client knows are returned (players, peds, vehicles, objects); an attachment to a map
prop answers undefined. Asking costs one game call per known entity at most.

#### Example

```ts
const carrier = await prop.getAttachedTo();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getAttachedTo`](../../entity/interfaces/EntityMp.md#getattachedto)

***

### getAttachedToCargobob()

> **getAttachedToCargobob**(): `Promise`\<`number`\>

The vehicle this cargobob carries.

#### Returns

`Promise`\<`number`\>

A promise of the carried vehicle's handle; 0 when it carries none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const load = await heli.getAttachedToCargobob();
```

***

### getAttachedToTowTruck()

> **getAttachedToTowTruck**(): `Promise`\<`number`\>

The entity on this tow truck's hook.

#### Returns

`Promise`\<`number`\>

A promise of the towed entity's handle; 0 when it tows none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const towed = await truck.getAttachedToTowTruck();
```

***

### getBodyHealth()

> **getBodyHealth**(): `Promise`\<`number`\>

The vehicle's body health, on the 0..1000 scale (1000 is undamaged).

#### Returns

`Promise`\<`number`\>

A Promise of the health.

#### Remarks

Asynchronous. The scale is 0..1000, as for the setter: the server's `bodyHealth` uses the same scale and starts at 1000.

#### Example

```ts
const body = await car.getBodyHealth();
```

***

### getBoneIndexByName()

> **getBoneIndexByName**(`bone`): `Promise`\<`number`\>

The index of a bone of the entity's skeleton, found by name.

#### Parameters

##### bone

`string` \| `number`

The bone's name (hashed when a string) or its hash.

#### Returns

`Promise`\<`number`\>

A Promise of the bone index.

#### Example

```ts
const head = await ped.getBoneIndexByName('SKEL_Head');
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getBoneIndexByName`](../../entity/interfaces/EntityMp.md#getboneindexbyname)

***

### getColours()

> **getColours**(`colorPrimary`, `colorSecondary`): `Promise`\<\{ `colorPrimary`: `number`; `colorSecondary`: `number`; \}\>

The vehicle's two colours.

#### Parameters

##### colorPrimary

`number`

Not used: the colours are the answer.

##### colorSecondary

`number`

Not used: the colours are the answer.

#### Returns

`Promise`\<\{ `colorPrimary`: `number`; `colorSecondary`: `number`; \}\>

A promise of the primary and secondary colour.

#### Remarks

Partial: not yet confirmed in the game. The colours are VI's indexes.

#### Example

```ts
const { colorPrimary } = await vehicle.getColours(0, 0);
```

***

### getCoords()

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

The entity's position from the game.

#### Parameters

##### alive

`boolean`

The game's flag for this query, passed as is.

#### Returns

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

A Promise of `{ x, y, z }` in metres.

#### Remarks

Asynchronous. Unlike [EntityMp.position](../../entity/interfaces/EntityMp.md#position), this asks the game and is not the client's copy.

#### Example

```ts
const pos = await entity.getCoords(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getCoords`](../../entity/interfaces/EntityMp.md#getcoords)

***

### getDoorAngleRatio()

> **getDoorAngleRatio**(`door`): `Promise`\<`number`\>

How far a door of the vehicle is open.

#### Parameters

##### door

`number`

The door, as the game numbers it.

#### Returns

`Promise`\<`number`\>

A promise of the ratio, 0 (shut) to 1 (open).

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
const open = await vehicle.getDoorAngleRatio(0);
```

***

### getDoorLockStatus()

> **getDoorLockStatus**(): `Promise`\<`number`\>

The vehicle's door lock status, as the game's number.

#### Returns

`Promise`\<`number`\>

A Promise of the status.

#### Remarks

Asynchronous. The game's numbering of the statuses is not stated here; returned as it is.

#### Example

```ts
const status = await car.getDoorLockStatus();
```

***

### getDoorsLockedForPlayer()

> **getDoorsLockedForPlayer**(`player`): `Promise`\<`boolean`\>

Whether the vehicle's doors are locked for a player.

#### Parameters

##### player

`number` \| \{ `handle`: `number`; \}

The player, or its handle.

#### Returns

`Promise`\<`boolean`\>

A promise of true when they are.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.getDoorsLockedForPlayer(mp.players.local)) { }
```

***

### getEngineHealth()

> **getEngineHealth**(): `Promise`\<`number`\>

The vehicle's engine health, on the 0..1000 scale (1000 is undamaged).

#### Returns

`Promise`\<`number`\>

A Promise of the health.

#### Remarks

Asynchronous. The scale is 0..1000, as for the setter: the server's `engineHealth` uses the same scale and starts at 1000.

#### Example

```ts
const engine = await car.getEngineHealth();
```

***

### getEntityAttachedToTowTruck()

> **getEntityAttachedToTowTruck**(`towTruck?`): `Promise`\<`number`\>

The entity on this tow truck's hook.

#### Parameters

##### towTruck?

`number`

Not used: this vehicle is the tow truck asked about.

#### Returns

`Promise`\<`number`\>

A promise of the towed entity's handle; 0 when it tows none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const towed = await truck.getEntityAttachedToTowTruck(truck.handle);
```

***

### getForwardVector()

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

The direction the entity faces.

#### Returns

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

A Promise of `{ x, y, z }`, as the game gives it.

#### Example

```ts
const forward = await entity.getForwardVector();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getForwardVector`](../../entity/interfaces/EntityMp.md#getforwardvector)

***

### getForwardX()

> **getForwardX**(): `Promise`\<`number`\>

The x part of the direction the entity faces.

#### Returns

`Promise`\<`number`\>

A Promise of the x of the forward vector (east is positive).

#### Remarks

Composed from [EntityMp.getForwardVector](../../entity/interfaces/EntityMp.md#getforwardvector).

#### Example

```ts
const x = await vehicle.getForwardX();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getForwardX`](../../entity/interfaces/EntityMp.md#getforwardx)

***

### getForwardY()

> **getForwardY**(): `Promise`\<`number`\>

The y part of the direction the entity faces.

#### Returns

`Promise`\<`number`\>

A Promise of the y of the forward vector (north is positive).

#### Remarks

Composed from [EntityMp.getForwardVector](../../entity/interfaces/EntityMp.md#getforwardvector).

#### Example

```ts
const y = await vehicle.getForwardY();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getForwardY`](../../entity/interfaces/EntityMp.md#getforwardy)

***

### getHeading()

> **getHeading**(): `number`

The entity's heading: the direction it faces, counter-clockwise from north.

#### Returns

`number`

The heading in degrees, 0 to 360.

#### Remarks

Answered from the client's own copy for players (their own and the others') and for server peds and
vehicles (the heading the server put them at). Server objects ask the game and return a Promise.

#### Example

```ts
const heading = player.getHeading();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getHeading`](../../entity/interfaces/EntityMp.md#getheading)

***

### getHealth()

> **getHealth**(): `number` \| `Promise`\<`number`\>

The entity's health, in the game's hit-point scale.

#### Returns

`number` \| `Promise`\<`number`\>

The health: a number for the local player, a Promise of it for the other kinds.

#### Remarks

Works on every kind of entity. Synchronous on the local player (the current value from the client's own
copy, so `mp.players.local.getHealth()` works without await); a Promise on remote players, peds, vehicles and
objects, where the game is asked (a vehicle's is its body health). `await` works on both. Setting it is
[EntityMp.setHealth](../../entity/interfaces/EntityMp.md#sethealth).

#### Example

```ts
const health = await ped.getHealth();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getHealth`](../../entity/interfaces/EntityMp.md#gethealth)

***

### getHeight()

> **getHeight**(`x`, `y`, `z`, `atTop`, `inWorldCoords`): `Promise`\<`number`\>

The height of the entity above a point, in metres.

#### Parameters

##### x

`number`

The point's x coordinate, metres.

##### y

`number`

The point's y coordinate, metres.

##### z

`number`

The point's z coordinate, metres.

##### atTop

`boolean`

The game's flag, passed as is.

##### inWorldCoords

`boolean`

The game's flag, passed as is.

#### Returns

`Promise`\<`number`\>

A Promise of the height in metres.

#### Example

```ts
const h = await entity.getHeight(0, 0, 70, false, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getHeight`](../../entity/interfaces/EntityMp.md#getheight)

***

### getHeightAboveGround()

> **getHeightAboveGround**(): `Promise`\<`number`\>

How high the entity is above the ground under it.

#### Returns

`Promise`\<`number`\>

A Promise of the height in metres.

#### Example

```ts
const above = await vehicle.getHeightAboveGround();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getHeightAboveGround`](../../entity/interfaces/EntityMp.md#getheightaboveground)

***

### getLandingGearState()

> **getLandingGearState**(): `Promise`\<`number`\>

The state of the vehicle's landing gear, as the game's number.

#### Returns

`Promise`\<`number`\>

A Promise of the state.

#### Remarks

Asynchronous. The game's meaning of each number is not stated here; returned as it is.

#### Example

```ts
const gear = await car.getLandingGearState();
```

***

### getLastPedInSeat()

> **getLastPedInSeat**(`seatIndex`): `Promise`\<`number`\>

The ped that last sat in a seat of this vehicle.

#### Parameters

##### seatIndex

`number`

The seat, numbered as the game numbers them.

#### Returns

`Promise`\<`number`\>

A promise of the ped's handle; 0 when there was none or it is none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const last = await vehicle.getLastPedInSeat(-1);
```

***

### getLayoutHash()

> **getLayoutHash**(): `Promise`\<`number`\>

The vehicle's layout (the arrangement of its seats and doors), as the game's 32-bit value.

#### Returns

`Promise`\<`number`\>

A Promise of the value.

#### Remarks

Asynchronous. An unsigned 32-bit number, not a model name.

#### Example

```ts
const layout = await car.getLayoutHash();
```

***

### getLiveryCount()

> **getLiveryCount**(): `Promise`\<`number`\>

How many liveries the vehicle has.

#### Returns

`Promise`\<`number`\>

A promise of the count.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
const count = await vehicle.getLiveryCount();
```

***

### getLodDist()

> **getLodDist**(): `Promise`\<`number`\>

The distance at which the entity switches to its less detailed model, in metres.

#### Returns

`Promise`\<`number`\>

A Promise of the distance in metres.

#### Example

```ts
const lod = await entity.getLodDist();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getLodDist`](../../entity/interfaces/EntityMp.md#getloddist)

***

### getMatrix()

> **getMatrix**(): `Promise`\<\{ `forwardVector`: [`IVector3`](../../common/interfaces/IVector3.md); `position`: [`IVector3`](../../common/interfaces/IVector3.md); `rightVector`: [`IVector3`](../../common/interfaces/IVector3.md); `upVector`: [`IVector3`](../../common/interfaces/IVector3.md); \}\>

The entity's axes in the world and its position.

#### Returns

`Promise`\<\{ `forwardVector`: [`IVector3`](../../common/interfaces/IVector3.md); `position`: [`IVector3`](../../common/interfaces/IVector3.md); `rightVector`: [`IVector3`](../../common/interfaces/IVector3.md); `upVector`: [`IVector3`](../../common/interfaces/IVector3.md); \}\>

A Promise of `{ rightVector, forwardVector, upVector, position }`: three unit vectors and the position in
metres.

#### Remarks

Composed from the entity's quaternion and coordinates. RAGE MP's four output parameters do not exist:
the result is returned. Axes are the game's: x east, y north, z up.

#### Example

```ts
const { forwardVector, position } = await vehicle.getMatrix();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getMatrix`](../../entity/interfaces/EntityMp.md#getmatrix)

***

### getMaxBraking()

> **getMaxBraking**(): `Promise`\<`number`\>

The vehicle's braking force.

#### Returns

`Promise`\<`number`\>

A promise of the force, in the game's scale.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
const braking = await vehicle.getMaxBraking();
```

***

### getMaxBreaking()

> **getMaxBreaking**(): `Promise`\<`number`\>

The vehicle's braking force: RAGE MP's other spelling of getMaxBraking.

#### Returns

`Promise`\<`number`\>

A promise of the force, in the game's scale.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
const braking = await vehicle.getMaxBreaking();
```

***

### getMaxHealth()

> **getMaxHealth**(): `Promise`\<`number`\>

The entity's maximum health, in the game's hit-point scale.

#### Returns

`Promise`\<`number`\>

A Promise of the maximum health.

#### Example

```ts
const max = await ped.getMaxHealth();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getMaxHealth`](../../entity/interfaces/EntityMp.md#getmaxhealth)

***

### getMaxNumberOfPassengers()

> **getMaxNumberOfPassengers**(): `Promise`\<`number`\>

The most passengers the game allows in the vehicle.

#### Returns

`Promise`\<`number`\>

A Promise of the count.

#### Remarks

Asynchronous.

#### Example

```ts
const seats = await car.getMaxNumberOfPassengers();
```

***

### getModel()

> **getModel**(): `Promise`\<`number`\>

The entity's model hash, as the game reports it.

#### Returns

`Promise`\<`number`\>

A Promise of the low 32 bits of the model hash.

#### Remarks

The `model` property has the model as the server gave it; this asks the game, and works for players too.

#### Example

```ts
const hash = await entity.getModel();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getModel`](../../entity/interfaces/EntityMp.md#getmodel)

***

### getModVariation()

> **getModVariation**(`modType`): `Promise`\<`boolean`\>

Whether a mod of the vehicle has its variation (custom tyres for the wheels).

#### Parameters

##### modType

`number`

The mod slot, as the game numbers it.

#### Returns

`Promise`\<`boolean`\>

A promise of true when it has.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.getModVariation(23)) { }
```

***

### getNearestPlayerTo()

> **getNearestPlayerTo**(): [`PlayerMp`](../../player/interfaces/PlayerMp.md)

The player closest to the entity.

#### Returns

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

The nearest other player (the entity itself is left out), or `null` when there is none.

#### Remarks

Measured on the last known positions, at once. Unlike RAGE MP, which gives a handle number, this gives
the player object (its `handle` is the number). It works on every kind of entity.

#### Example

```ts
const other = player.getNearestPlayerTo();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getNearestPlayerTo`](../../entity/interfaces/EntityMp.md#getnearestplayerto)

***

### getNumberOfColours()

> **getNumberOfColours**(): `Promise`\<`number`\>

How many colours the vehicle can be painted in.

#### Returns

`Promise`\<`number`\>

A promise of the count.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const n = await vehicle.getNumberOfColours();
```

***

### getNumberOfDoors()

> **getNumberOfDoors**(): `Promise`\<`number`\>

How many doors the vehicle has.

#### Returns

`Promise`\<`number`\>

A promise of the count.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const n = await vehicle.getNumberOfDoors();
```

***

### getNumberOfPassengers()

> **getNumberOfPassengers**(): `Promise`\<`number`\>

The number of passengers now in the vehicle.

#### Returns

`Promise`\<`number`\>

A Promise of the count.

#### Remarks

Asynchronous.

#### Example

```ts
const inside = await car.getNumberOfPassengers();
```

***

### getObjectIndexFromIndex()

> **getObjectIndexFromIndex**(): `number`

The entity's handle when it is an object, otherwise 0.

#### Returns

`number`

The handle of an object, 0 for any other kind of entity or while the handle is 0.

#### Remarks

The handle of an entity already is the typed index, so this is worked out from the handle's kind and
does not ask the game; it answers at once.

#### Example

```ts
const index = entity.getObjectIndexFromIndex();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getObjectIndexFromIndex`](../../entity/interfaces/EntityMp.md#getobjectindexfromindex)

***

### getOffsetFromGivenWorldCoords()

> **getOffsetFromGivenWorldCoords**(`posX`, `posY`, `posZ`): `Promise`\<[`IVector3`](../../common/interfaces/IVector3.md)\>

A point in the world, given in the entity's own axes.

#### Parameters

##### posX

`number`

The world x in metres.

##### posY

`number`

The world y in metres.

##### posZ

`number`

The world z in metres.

#### Returns

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

A Promise of the offset in metres: x to the entity's right, y in front, z above.

#### Remarks

Composed from the entity's quaternion and coordinates; the opposite of
[EntityMp.getOffsetFromInWorldCoords](../../entity/interfaces/EntityMp.md#getoffsetfrominworldcoords).

#### Example

```ts
const offset = await vehicle.getOffsetFromGivenWorldCoords(0, 0, 70);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getOffsetFromGivenWorldCoords`](../../entity/interfaces/EntityMp.md#getoffsetfromgivenworldcoords)

***

### getOffsetFromInWorldCoords()

> **getOffsetFromInWorldCoords**(`offsetX`, `offsetY`, `offsetZ`): `Promise`\<[`IVector3`](../../common/interfaces/IVector3.md)\>

A point given in the entity's own axes, as a point in the world.

#### Parameters

##### offsetX

`number`

Metres to the entity's right.

##### offsetY

`number`

Metres in front of the entity.

##### offsetZ

`number`

Metres above the entity.

#### Returns

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

A Promise of the world position in metres.

#### Remarks

Composed from the entity's quaternion and coordinates.

#### Example

```ts
const bumper = await vehicle.getOffsetFromInWorldCoords(0, 2.5, 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getOffsetFromInWorldCoords`](../../entity/interfaces/EntityMp.md#getoffsetfrominworldcoords)

***

### getPedIndexFromIndex()

> **getPedIndexFromIndex**(): `number`

The entity's handle when it is a ped, otherwise 0.

#### Returns

`number`

The handle of a ped or a player (a player is a ped for the game), 0 for vehicles and objects.

#### Remarks

Worked out from the handle's kind, not asked of the game; it answers at once.

#### Example

```ts
const index = entity.getPedIndexFromIndex();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getPedIndexFromIndex`](../../entity/interfaces/EntityMp.md#getpedindexfromindex)

***

### getPedInSeat()

> **getPedInSeat**(`index`): `Promise`\<`number`\>

The ped in a seat of this vehicle.

#### Parameters

##### index

`number`

The seat, numbered as the game numbers them.

#### Returns

`Promise`\<`number`\>

A promise of the ped's handle; 0 when the seat is empty or the ped is none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const driver = await vehicle.getPedInSeat(-1);
```

***

### getPetrolTankHealth()

> **getPetrolTankHealth**(): `Promise`\<`number`\>

The vehicle's fuel tank health, on the 0..1000 scale (1000 is undamaged).

#### Returns

`Promise`\<`number`\>

A Promise of the health.

#### Remarks

Asynchronous.

#### Example

```ts
const tank = await car.getPetrolTankHealth();
```

***

### getPhysicsHeading()

> **getPhysicsHeading**(): `Promise`\<`number`\>

The heading the entity's physics has.

#### Returns

`Promise`\<`number`\>

The heading in degrees, 0 to 360, as [EntityMp.getHeading](../../entity/interfaces/EntityMp.md#getheading) gives it.

#### Remarks

The game has no separate physics heading, so this is the same value as `getHeading()`. Asynchronous,
unlike RAGE MP's.

#### Example

```ts
const heading = await vehicle.getPhysicsHeading();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getPhysicsHeading`](../../entity/interfaces/EntityMp.md#getphysicsheading)

***

### getPitch()

> **getPitch**(): `Promise`\<`number`\>

The entity's pitch: how far its nose points up or down.

#### Returns

`Promise`\<`number`\>

A Promise of the angle in degrees, positive looking up.

#### Remarks

Composed from [EntityMp.getRotation](../../entity/interfaces/EntityMp.md#getrotation).

#### Example

```ts
const pitch = await vehicle.getPitch();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getPitch`](../../entity/interfaces/EntityMp.md#getpitch)

***

### getPlateType()

> **getPlateType**(): `Promise`\<`number`\>

The vehicle's number-plate type, as the game's number.

#### Returns

`Promise`\<`number`\>

A Promise of the type.

#### Remarks

Asynchronous. The game's numbering is not stated here; returned as it is.

#### Example

```ts
const plate = await car.getPlateType();
```

***

### getPopulationType()

> **getPopulationType**(): `Promise`\<`number`\>

The population type number the game gives the entity.

#### Returns

`Promise`\<`number`\>

A Promise of the game's number for it.

#### Example

```ts
const kind = await ped.getPopulationType();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getPopulationType`](../../entity/interfaces/EntityMp.md#getpopulationtype)

***

### getQuaternion()

> **getQuaternion**(): `Promise`\<\{ `w`: `number`; `x`: `number`; `y`: `number`; `z`: `number`; \}\>

The entity's rotation as a quaternion.

#### Returns

`Promise`\<\{ `w`: `number`; `x`: `number`; `y`: `number`; `z`: `number`; \}\>

A Promise of `{ x, y, z, w }`, as the game gives it.

#### Example

```ts
const q = await entity.getQuaternion();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getQuaternion`](../../entity/interfaces/EntityMp.md#getquaternion)

***

### getRoll()

> **getRoll**(): `Promise`\<`number`\>

The entity's roll: how far it leans to a side.

#### Returns

`Promise`\<`number`\>

A Promise of the angle in degrees.

#### Remarks

Composed from [EntityMp.getRotation](../../entity/interfaces/EntityMp.md#getrotation).

#### Example

```ts
const roll = await vehicle.getRoll();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getRoll`](../../entity/interfaces/EntityMp.md#getroll)

***

### getRotation()

> **getRotation**(`order?`): `Promise`\<[`IVector3`](../../common/interfaces/IVector3.md)\>

The entity's rotation, in degrees.

#### Parameters

##### order?

`number`

The rotation order the game uses; 2 when omitted.

#### Returns

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

A Promise of `{ x, y, z }` in degrees: pitch, roll and yaw.

#### Example

```ts
const rot = await entity.getRotation();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getRotation`](../../entity/interfaces/EntityMp.md#getrotation)

***

### getRotationVelocity()

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

The entity's angular velocity (how fast it turns).

#### Returns

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

A Promise of `{ x, y, z }`, not converted by SixL: the game's unit (radians per second).

#### Example

```ts
const spin = await entity.getRotationVelocity();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getRotationVelocity`](../../entity/interfaces/EntityMp.md#getrotationvelocity)

***

### getScript()

> **getScript**(`script?`): `Promise`\<`number`\>

The hash the game gives the script that owns the entity.

#### Parameters

##### script?

`number`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`Promise`\<`number`\>

A Promise of the hash of the owning script's name, 0 when no script owns the entity.

#### Remarks

Partial: RAGE MP answers a script handle; here the answer is the hash the game reports, not a name.

#### Example

```ts
const owner = await entity.getScript();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getScript`](../../entity/interfaces/EntityMp.md#getscript)

***

### getSpeed()

> **getSpeed**(): `number` \| `Promise`\<`number`\>

The entity's speed: the length of its velocity.

#### Returns

`number` \| `Promise`\<`number`\>

The speed in metres per second: a number for the local player, a Promise of it for the other kinds.

#### Remarks

Works on every kind of entity. Synchronous on the local player (the current speed from the client's own
copy, so `mp.players.local.getSpeed()` works without await); a Promise on remote players, peds, vehicles and objects,
where the game is asked. `await` works on both.

#### Example

```ts
const speed = await vehicle.getSpeed();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getSpeed`](../../entity/interfaces/EntityMp.md#getspeed)

***

### getSpeedVector()

> **getSpeedVector**(`relative`): `Promise`\<[`IVector3`](../../common/interfaces/IVector3.md)\>

The velocity of the entity relative to the world or to itself.

#### Parameters

##### relative

`boolean`

The game's flag: whether the velocity is taken relative to the entity, passed as is.

#### Returns

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

A Promise of `{ x, y, z }` in metres per second.

#### Example

```ts
const v = await entity.getSpeedVector(false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getSpeedVector`](../../entity/interfaces/EntityMp.md#getspeedvector)

***

### getSubmergedLevel()

> **getSubmergedLevel**(): `Promise`\<`number`\>

How much of the entity is under water.

#### Returns

`Promise`\<`number`\>

A Promise of the submerged level, as the game reports it.

#### Example

```ts
const sunk = await entity.getSubmergedLevel();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getSubmergedLevel`](../../entity/interfaces/EntityMp.md#getsubmergedlevel)

***

### getTrailer()

> **getTrailer**(`vehicle?`): `Promise`\<`number`\>

The trailer this vehicle tows.

#### Parameters

##### vehicle?

`number`

Not used (kept for RAGE MP's signature).

#### Returns

`Promise`\<`number`\>

A promise of the trailer's handle; 0 without a trailer or when it is none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const trailer = await truck.getTrailer();
```

***

### getTrainCarriage()

> **getTrainCarriage**(`carriage`): `Promise`\<`number`\>

A carriage of this train.

#### Parameters

##### carriage

`number`

Which carriage.

#### Returns

`Promise`\<`number`\>

A promise of the carriage's handle; 0 when there is none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const first = await train.getTrainCarriage(1);
```

***

### getType()

> **getType**(): `Promise`\<`number`\>

The game's number for what kind of entity this is.

#### Returns

`Promise`\<`number`\>

A Promise of the number: 0 none, 1 ped, 2 vehicle, 3 object. A player is a ped for the game.

#### Remarks

Not the same as the `type` property, which is the string `'player'`, `'ped'`, `'vehicle'` or `'object'`.

#### Example

```ts
const kind = await entity.getType();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getType`](../../entity/interfaces/EntityMp.md#gettype)

***

### getTyresCanBurst()

> **getTyresCanBurst**(): `Promise`\<`boolean`\>

Whether the vehicle's tyres can burst.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const burst = await car.getTyresCanBurst();
```

***

### getUprightValue()

> **getUprightValue**(): `Promise`\<`number`\>

How upright the entity is.

#### Returns

`Promise`\<`number`\>

A Promise of the upright value as the game reports it.

#### Example

```ts
const upright = await vehicle.getUprightValue();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getUprightValue`](../../entity/interfaces/EntityMp.md#getuprightvalue)

***

### getVariable()

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

Reads a shared variable of the entity, sent by the server (`entity.setVariable` on the server).

#### Type Parameters

##### T

`T` = `any`

#### Parameters

##### key

`string`

The variable's name.

#### Returns

`T`

The value, or `undefined` when the entity has no such variable.

#### Remarks

Works for players, peds, vehicles and objects; the values come from the server's data for the entity. A variable
that arrives before the entity is placed in the game is kept until it is.

#### Example

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

#### Inherited from

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

***

### getVehicleIndexFromIndex()

> **getVehicleIndexFromIndex**(): `number`

The entity's handle when it is a vehicle, otherwise 0.

#### Returns

`number`

The handle of a vehicle, 0 for any other kind of entity or while the vehicle is not shown yet.

#### Remarks

Worked out from the handle's kind, not asked of the game; it answers at once.

#### Example

```ts
const index = entity.getVehicleIndexFromIndex();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getVehicleIndexFromIndex`](../../entity/interfaces/EntityMp.md#getvehicleindexfromindex)

***

### getVehicleTrailer()

> **getVehicleTrailer**(`vehicle?`): `Promise`\<`number`\>

The trailer this vehicle tows (RAGE MP's other name of `getTrailer`).

#### Parameters

##### vehicle?

`number`

Not used (kept for RAGE MP's signature).

#### Returns

`Promise`\<`number`\>

A promise of the trailer's handle; 0 without a trailer or when it is none this client has.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
const trailer = await truck.getVehicleTrailer();
```

***

### getVelocity()

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

The entity's velocity as a vector.

#### Returns

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

The velocity in metres per second, as a [Vector3](../../common/interfaces/Vector3.md), in world axes: a value for the local player, a Promise of it for the other kinds.

#### Remarks

Works on every kind of entity. Synchronous on the local player (the current velocity from the client's own
copy); a Promise on the others, where it is the game's speed vector, the same numbers as `getSpeedVector(false)`.
`await` works on both.

#### Example

```ts
const v = await vehicle.getVelocity();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`getVelocity`](../../entity/interfaces/EntityMp.md#getvelocity)

***

### hasAnimEventFired()

> **hasAnimEventFired**(`action`): `Promise`\<`boolean`\>

Whether an animation event of the entity has fired.

#### Parameters

##### action

`string` \| `number`

The event's name (hashed when a string) or its hash.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const fired = await ped.hasAnimEventFired('FootL');
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasAnimEventFired`](../../entity/interfaces/EntityMp.md#hasanimeventfired)

***

### hasAnimFinished()

> **hasAnimFinished**(`dictionary`, `name`, `p2?`): `Promise`\<`boolean`\>

Whether a clip has played to its end on the entity.

#### Parameters

##### dictionary

`string` \| `number`

The animation dictionary's name (hashed when a string) or its hash.

##### name

`string` \| `number`

The animation's name (hashed when a string) or its hash.

##### p2?

`number`

Unused: kept for scripts written for RAGE MP.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when the clip's phase has reached 1, else false.

#### Remarks

Composed from `getAnimCurrentTime` read as a phase from 0 to 1. A clip that loops never finishes.

#### Example

```ts
const done = await ped.hasAnimFinished('move_m@', 'walk', 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasAnimFinished`](../../entity/interfaces/EntityMp.md#hasanimfinished)

***

### hasBeenDamagedBy()

> **hasBeenDamagedBy**(`entity`, `p1`): `Promise`\<`boolean`\>

Whether a given entity has damaged this one: the same question as [EntityMp.hasBeenDamagedByEntity](../../entity/interfaces/EntityMp.md#hasbeendamagedbyentity).

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The entity that may have done the damage.

##### p1

`boolean`

Passed to the game as its flag (the game's own meaning).

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const fromPlayer = await vehicle.hasBeenDamagedBy(player, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasBeenDamagedBy`](../../entity/interfaces/EntityMp.md#hasbeendamagedby)

***

### hasBeenDamagedByAnyObject()

> **hasBeenDamagedByAnyObject**(): `Promise`\<`boolean`\>

Whether any object has damaged the entity.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const hit = await vehicle.hasBeenDamagedByAnyObject();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasBeenDamagedByAnyObject`](../../entity/interfaces/EntityMp.md#hasbeendamagedbyanyobject)

***

### hasBeenDamagedByAnyPed()

> **hasBeenDamagedByAnyPed**(): `Promise`\<`boolean`\>

Whether any ped has damaged the entity.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const hit = await vehicle.hasBeenDamagedByAnyPed();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasBeenDamagedByAnyPed`](../../entity/interfaces/EntityMp.md#hasbeendamagedbyanyped)

***

### hasBeenDamagedByAnyVehicle()

> **hasBeenDamagedByAnyVehicle**(): `Promise`\<`boolean`\>

Whether any vehicle has damaged the entity.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const hit = await ped.hasBeenDamagedByAnyVehicle();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasBeenDamagedByAnyVehicle`](../../entity/interfaces/EntityMp.md#hasbeendamagedbyanyvehicle)

***

### hasBeenDamagedByEntity()

> **hasBeenDamagedByEntity**(`entity`, `p2`): `Promise`\<`boolean`\>

Whether a given entity has damaged this one.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The entity that may have done the damage.

##### p2

`boolean`

Passed to the game as its flag (the game's own meaning).

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const fromPlayer = await vehicle.hasBeenDamagedByEntity(player, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasBeenDamagedByEntity`](../../entity/interfaces/EntityMp.md#hasbeendamagedbyentity)

***

### hasClearLosTo()

> **hasClearLosTo**(`entity`, `traceType`): `Promise`\<`boolean`\>

Whether there is a clear line of sight from the entity to another.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The other entity, or its `handle`.

##### traceType

`number`

What blocks the line: bit 1 and bit 16 are passed to the game as its two flags, 0 sets neither.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when nothing blocks the line.

#### Remarks

The game takes two flags where RAGE MP has one trace type; the mapping of the bits is the one set out
here and is confirmed by the recording. Rejects while either entity has handle 0.

#### Example

```ts
const sees = await ped.hasClearLosTo(mp.players.local, 17);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasClearLosTo`](../../entity/interfaces/EntityMp.md#hasclearlosto)

***

### hasClearLosToInFront()

> **hasClearLosToInFront**(`entity`): `Promise`\<`boolean`\>

Whether there is a clear line of sight to another entity that is in front of this one.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The other entity.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when the other entity is on the forward side of this one and nothing blocks the line.

#### Remarks

Made from the entity's forward direction and the plain line of sight (trace type 1). Rejects while either
entity has handle 0.

#### Example

```ts
const ahead = await ped.hasClearLosToInFront(mp.players.local);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasClearLosToInFront`](../../entity/interfaces/EntityMp.md#hasclearlostoinfront)

***

### hasCollidedWithAnything()

> **hasCollidedWithAnything**(): `Promise`\<`boolean`\>

Whether the entity has collided with something, as the game reports it.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const crashed = await vehicle.hasCollidedWithAnything();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasCollidedWithAnything`](../../entity/interfaces/EntityMp.md#hascollidedwithanything)

***

### hasVariable()

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

Whether the entity has a shared variable with this name.

#### Parameters

##### key

`string`

The variable's name.

#### Returns

`boolean`

True when the variable is set on the entity.

#### Example

```ts
if (vehicle.hasVariable('locked')) { }
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`hasVariable`](../../entity/interfaces/EntityMp.md#hasvariable)

***

### isAConvertible()

> **isAConvertible**(`checkRoofExtras`): `Promise`\<`boolean`\>

Whether the vehicle is a convertible.

#### Parameters

##### checkRoofExtras

`boolean`

Passed to the game as it is: whether the roof's extras count.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const open = await car.isAConvertible(false);
```

***

### isAlarmActivated()

> **isAlarmActivated**(): `Promise`\<`boolean`\>

Whether the vehicle's alarm is sounding.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const alarm = await car.isAlarmActivated();
```

***

### isAMission()

> **isAMission**(): `Promise`\<`boolean`\>

Whether the entity is a mission entity: one the game keeps while the script that made it runs.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const kept = await entity.isAMission();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAMission`](../../entity/interfaces/EntityMp.md#isamission)

***

### isAnObject()

> **isAnObject**(): `Promise`\<`boolean`\>

Whether the entity is an object.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const prop = await entity.isAnObject();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAnObject`](../../entity/interfaces/EntityMp.md#isanobject)

***

### isAnySeatEmpty()

> **isAnySeatEmpty**(): `Promise`\<`boolean`\>

Whether any seat of the vehicle is free.

#### Returns

`Promise`\<`boolean`\>

A promise of true when one is.

#### Remarks

Partial: not yet confirmed in the game. Each seat of the model is asked in turn.

#### Example

```ts
if (await vehicle.isAnySeatEmpty()) { }
```

***

### isAPed()

> **isAPed**(): `Promise`\<`boolean`\>

Whether the entity is a ped.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const ped = await entity.isAPed();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAPed`](../../entity/interfaces/EntityMp.md#isaped)

***

### isAt()

> **isAt**(`entity`, `xSize`, `ySize`, `zSize`, `p4?`, `p5?`, `p6?`): `Promise`\<`boolean`\>

Whether the entity is inside a box around another entity.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The other entity, or its `handle`.

##### xSize

`number`

How far the box reaches east and west of the other entity (metres).

##### ySize

`number`

How far the box reaches north and south of the other entity (metres).

##### zSize

`number`

How far the box reaches up and down from the other entity (metres).

##### p4?

`boolean`

Accepted for RAGE MP compatibility; ignored.

##### p5?

`boolean`

Accepted for RAGE MP compatibility; ignored.

##### p6?

`number`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when this entity is inside the box; the edge counts as inside.

#### Remarks

Both positions are asked of the game. The box is axis-aligned with the world and a size is the reach on
each side of the centre. Rejects while either entity has handle 0.

#### Example

```ts
const close = await ped.isAt(mp.players.local, 2, 2, 2, false, false, 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAt`](../../entity/interfaces/EntityMp.md#isat)

***

### isAtCoord()

> **isAtCoord**(`xPos`, `yPos`, `zPos`, `xSize`, `ySize`, `zSize`, `p6?`, `p7?`, `p8?`): `Promise`\<`boolean`\>

Whether the entity is inside a box around a point.

#### Parameters

##### xPos

`number`

Centre of the box, x (metres).

##### yPos

`number`

Centre of the box, y (metres).

##### zPos

`number`

Centre of the box, z (metres).

##### xSize

`number`

How far the box reaches east and west of the centre (metres).

##### ySize

`number`

How far the box reaches north and south of the centre (metres).

##### zSize

`number`

How far the box reaches up and down from the centre (metres).

##### p6?

`boolean`

Accepted for RAGE MP compatibility; ignored.

##### p7?

`boolean`

Accepted for RAGE MP compatibility; ignored.

##### p8?

`number`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when the entity is inside the box; the edge counts as inside.

#### Remarks

The entity's position is asked of the game. Rejects while the entity has handle 0.

#### Example

```ts
const there = await player.isAtCoord(10, 20, 30, 2, 2, 2, false, false, 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAtCoord`](../../entity/interfaces/EntityMp.md#isatcoord)

***

### isAttached()

> **isAttached**(): `Promise`\<`boolean`\>

Whether the entity is attached to something.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const attached = await entity.isAttached();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAttached`](../../entity/interfaces/EntityMp.md#isattached)

***

### isAttachedTo()

> **isAttachedTo**(`entity`): `Promise`\<`boolean`\>

Whether this entity is attached to the given one.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The possible carrier: an entity object or its handle.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const onTruck = await prop.isAttachedTo(truck);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAttachedTo`](../../entity/interfaces/EntityMp.md#isattachedto)

***

### isAttachedToAnyObject()

> **isAttachedToAnyObject**(): `Promise`\<`boolean`\>

Whether the entity is attached to an object.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const onProp = await entity.isAttachedToAnyObject();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAttachedToAnyObject`](../../entity/interfaces/EntityMp.md#isattachedtoanyobject)

***

### isAttachedToAnyPed()

> **isAttachedToAnyPed**(): `Promise`\<`boolean`\>

Whether the entity is attached to a ped.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const onPed = await entity.isAttachedToAnyPed();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAttachedToAnyPed`](../../entity/interfaces/EntityMp.md#isattachedtoanyped)

***

### isAttachedToAnyVehicle()

> **isAttachedToAnyVehicle**(): `Promise`\<`boolean`\>

Whether the entity is attached to a vehicle.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const onCar = await entity.isAttachedToAnyVehicle();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAttachedToAnyVehicle`](../../entity/interfaces/EntityMp.md#isattachedtoanyvehicle)

***

### isAttachedToTowTruck()

> **isAttachedToTowTruck**(`vehicle`): `Promise`\<`boolean`\>

Whether the vehicle is attached to a tow truck.

#### Parameters

##### vehicle

`number` \| \{ `handle`: `number`; \}

The other vehicle, or its handle.

#### Returns

`Promise`\<`boolean`\>

A promise of true when it is.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await towTruck.isAttachedToTowTruck(car)) { }
```

***

### isAttachedToTrailer()

> **isAttachedToTrailer**(): `Promise`\<`boolean`\>

Whether the vehicle pulls a trailer.

#### Returns

`Promise`\<`boolean`\>

A promise of true when it does.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.isAttachedToTrailer()) { }
```

***

### isAVehicle()

> **isAVehicle**(): `Promise`\<`boolean`\>

Whether the entity is a vehicle.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const car = await entity.isAVehicle();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isAVehicle`](../../entity/interfaces/EntityMp.md#isavehicle)

***

### isCollisonDisabled()

> **isCollisonDisabled**(): `Promise`\<`boolean`\>

Whether the entity's collision is turned off.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const off = await ped.isCollisonDisabled();
```

#### Remarks

The name keeps RAGE MP's spelling.

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isCollisonDisabled`](../../entity/interfaces/EntityMp.md#iscollisondisabled)

***

### isDead()

> **isDead**(): `boolean` \| `Promise`\<`boolean`\>

Whether the entity is dead.

#### Returns

`boolean` \| `Promise`\<`boolean`\>

True when the entity is dead: a boolean for the local player, a Promise of it for the other kinds.

#### Remarks

Works on every kind of entity. Synchronous on the local player (the death flag of the client's own copy);
a Promise on remote players, peds, vehicles and objects, where the game is asked. `await` works on both.

#### Example

```ts
const dead = await ped.isDead();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isDead`](../../entity/interfaces/EntityMp.md#isdead)

***

### isDoorDamaged()

> **isDoorDamaged**(`doorId`): `Promise`\<`boolean`\>

Whether a door of the vehicle is damaged.

#### Parameters

##### doorId

`number`

The door, as the game numbers it.

#### Returns

`Promise`\<`boolean`\>

A promise of true when it is.

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.isDoorDamaged(0)) { }
```

***

### isDoorFullyOpen()

> **isDoorFullyOpen**(`doorIndex`): `Promise`\<`boolean`\>

Whether a door is fully open.

#### Parameters

##### doorIndex

`number`

The door's index, in the game's numbering.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const open = await car.isDoorFullyOpen(0);
```

***

### isDriveable()

> **isDriveable**(`checkfire`): `Promise`\<`boolean`\>

Whether the vehicle can be driven.

#### Parameters

##### checkfire

`boolean`

Passed to the game as it is: whether a burning vehicle is checked too.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const ok = await car.isDriveable(true);
```

***

### isExtraTurnedOn()

> **isExtraTurnedOn**(`extraId`): `Promise`\<`boolean`\>

Whether an extra part of the vehicle is switched on.

#### Parameters

##### extraId

`number`

The extra's index, in the game's numbering.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const on = await car.isExtraTurnedOn(1);
```

***

### isHeliPartBroken()

> **isHeliPartBroken**(`mainRotor`, `rearRotor`, `tailBoom`): `Promise`\<`boolean`\>

Whether one of the helicopter parts chosen by the flags is broken.

#### Parameters

##### mainRotor

`boolean`

Whether the main rotor is one of the parts checked.

##### rearRotor

`boolean`

Whether the rear rotor is one of the parts checked.

##### tailBoom

`boolean`

Whether the tail boom is one of the parts checked.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous. The flags are passed to the game as they are.

#### Example

```ts
const broken = await heli.isHeliPartBroken(true, false, false);
```

***

### isInAir()

> **isInAir**(): `Promise`\<`boolean`\>

Whether the entity is in the air, as the game reports it.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const flying = await player.isInAir();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isInAir`](../../entity/interfaces/EntityMp.md#isinair)

***

### isInAngledArea()

> **isInAngledArea**(`originX`, `originY`, `originZ`, `edgeX`, `edgeY`, `edgeZ`, `angle`, `p7?`, `p8?`, `p9?`): `Promise`\<`boolean`\>

Whether the entity is inside an angled area: a slab along a line on the ground.

#### Parameters

##### originX

`number`

Start of the centre line, x (metres).

##### originY

`number`

Start of the centre line, y (metres).

##### originZ

`number`

Start of the centre line, z (metres); with `edgeZ` it bounds the height.

##### edgeX

`number`

End of the centre line, x (metres).

##### edgeY

`number`

End of the centre line, y (metres).

##### edgeZ

`number`

End of the centre line, z (metres).

##### angle

`number`

The width of the slab across the line (metres).

##### p7?

`boolean`

Accepted for RAGE MP compatibility; ignored.

##### p8?

`boolean`

Accepted for RAGE MP compatibility; ignored.

##### p9?

`any`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when the entity is between the two ends, no further than half the width from the line
and between the two heights; the edge counts as inside.

#### Remarks

The entity's position is asked of the game. A line of zero length is no area. Rejects while the entity
has handle 0.

#### Example

```ts
const inLane = await vehicle.isInAngledArea(0, 0, 0, 0, 50, 5, 6, false, false, 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isInAngledArea`](../../entity/interfaces/EntityMp.md#isinangledarea)

***

### isInArea()

> **isInArea**(`x1`, `y1`, `z1`, `x2`, `y2`, `z2`, `p7?`, `p8?`, `p9?`): `Promise`\<`boolean`\>

Whether the entity is inside an area: the box between two corners.

#### Parameters

##### x1

`number`

First corner, x (metres).

##### y1

`number`

First corner, y (metres).

##### z1

`number`

First corner, z (metres).

##### x2

`number`

Second corner, x (metres).

##### y2

`number`

Second corner, y (metres).

##### z2

`number`

Second corner, z (metres).

##### p7?

`boolean`

Passed to the game as its flag.

##### p8?

`boolean`

Passed to the game as its flag.

##### p9?

`number`

Passed to the game as its number.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const inside = await entity.isInArea(0, 0, 0, 10, 10, 10, false, false, 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isInArea`](../../entity/interfaces/EntityMp.md#isinarea)

***

### isInBurnout()

> **isInBurnout**(): `Promise`\<`boolean`\>

Whether the vehicle is doing a burnout (its wheels spin in place).

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const spin = await car.isInBurnout();
```

***

### isInWater()

> **isInWater**(): `Promise`\<`boolean`\>

Whether the entity is in water.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const swimming = await player.isInWater();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isInWater`](../../entity/interfaces/EntityMp.md#isinwater)

***

### isModel()

> **isModel**(`model`): `Promise`\<`boolean`\>

Whether the vehicle is of a model.

#### Parameters

##### model

`string` \| `number`

The model: a name, or a hash that `mp.joaat` computed. A name with no model key in this build
is not found and is not the vehicle's model.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous. The model is turned into the game's model key first, so the answer comes later.

#### Example

```ts
const isSultan = await car.isModel('sultan');
```

***

### isOccluded()

> **isOccluded**(): `Promise`\<`boolean`\>

Whether something blocks the entity from the camera (occlusion), as the game reports it.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const hidden = await ped.isOccluded();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isOccluded`](../../entity/interfaces/EntityMp.md#isoccluded)

***

### isOnAllWheels()

> **isOnAllWheels**(): `Promise`\<`boolean`\>

Whether all of the vehicle's wheels touch the ground.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const grounded = await car.isOnAllWheels();
```

***

### isOnScreen()

> **isOnScreen**(): `Promise`\<`boolean`\>

Whether the entity is on the screen.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const onScreen = await ped.isOnScreen();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isOnScreen`](../../entity/interfaces/EntityMp.md#isonscreen)

***

### isPlayingAnim()

> **isPlayingAnim**(`dictionary`, `name`, `flag`): `Promise`\<`boolean`\>

Whether an animation is playing on the entity.

#### Parameters

##### dictionary

`string` \| `number`

The animation dictionary's name (hashed when a string) or its hash.

##### name

`string` \| `number`

The animation's name (hashed when a string) or its hash.

##### flag

`number`

Passed to the game as its task flag.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const playing = await ped.isPlayingAnim('move_m@', 'walk', 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isPlayingAnim`](../../entity/interfaces/EntityMp.md#isplayinganim)

***

### isSeatFree()

> **isSeatFree**(`seatIndex`): `Promise`\<`boolean`\>

Whether a seat of the vehicle is free.

#### Parameters

##### seatIndex

`number`

The seat's index, in the game's numbering.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const free = await car.isSeatFree(-1);
```

***

### isSirenOn()

> **isSirenOn**(): `Promise`\<`boolean`\>

Whether the vehicle's siren is on.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const siren = await car.isSirenOn();
```

***

### isSirenSoundOn()

> **isSirenSoundOn**(): `Promise`\<`boolean`\>

Whether the vehicle's siren sounds.

#### Returns

`Promise`\<`boolean`\>

A promise of true while it does.

#### Remarks

Partial: not yet confirmed in the game.

#### Example

```ts
if (await vehicle.isSirenSoundOn()) { }
```

***

### isStatic()

> **isStatic**(): `Promise`\<`boolean`\>

Whether the entity is static, as the game reports it.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const fixed = await entity.isStatic();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isStatic`](../../entity/interfaces/EntityMp.md#isstatic)

***

### isStolen()

> **isStolen**(): `Promise`\<`boolean`\>

Whether the vehicle is flagged as stolen.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const stolen = await car.isStolen();
```

***

### isStopped()

> **isStopped**(): `Promise`\<`boolean`\>

Whether the vehicle is stopped.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const still = await car.isStopped();
```

***

### isStoppedAtTrafficLights()

> **isStoppedAtTrafficLights**(): `Promise`\<`boolean`\>

Whether the vehicle is stopped at traffic lights.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const atLights = await car.isStoppedAtTrafficLights();
```

***

### isStuckOnRoof()

> **isStuckOnRoof**(): `Promise`\<`boolean`\>

Whether the vehicle is stuck on its roof.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const upsideDown = await car.isStuckOnRoof();
```

***

### isStuckTimerUp()

> **isStuckTimerUp**(`type`, `requiredTime`): `Promise`\<`boolean`\>

Whether the stuck timer of a kind has run for the required time.

#### Parameters

##### type

`number`

The kind of stuck check, as the game's number.

##### requiredTime

`number`

The time to wait, in milliseconds.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const stuck = await car.isStuckTimerUp(0, 5000);
```

***

### isTouching()

> **isTouching**(`entity`): `Promise`\<`boolean`\>

Whether the entity touches another entity.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The other entity (an entity object or its handle).

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const touching = await prop.isTouching(vehicle);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isTouching`](../../entity/interfaces/EntityMp.md#istouching)

***

### isTouchingModel()

> **isTouchingModel**(`model`): `Promise`\<`boolean`\>

Whether the entity touches a model: another entity of that model, or a model placed in the world.

#### Parameters

##### model

`string` \| `number`

The model's name (hashed when a string) or its hash.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const onRamp = await vehicle.isTouchingModel('<prop name>');
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isTouchingModel`](../../entity/interfaces/EntityMp.md#istouchingmodel)

***

### isTyreBurst()

> **isTyreBurst**(`wheelId`, `completely`): `Promise`\<`boolean`\>

Whether a tyre is burst.

#### Parameters

##### wheelId

`number`

The tyre's index, in the game's numbering.

##### completely

`boolean`

Passed to the game as it is: whether the tyre must be burst completely.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const burst = await car.isTyreBurst(0, false);
```

***

### isUpright()

> **isUpright**(`angle`): `Promise`\<`boolean`\>

Whether the entity is upright, within an angle.

#### Parameters

##### angle

`number`

The tolerance in degrees.

#### Returns

`Promise`\<`boolean`\>

A Promise of true when the entity's tilt is within the tolerance.

#### Example

```ts
const standing = await vehicle.isUpright(30);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isUpright`](../../entity/interfaces/EntityMp.md#isupright)

***

### isUpsidedown()

> **isUpsidedown**(): `Promise`\<`boolean`\>

Whether the entity is upside down.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const flipped = await vehicle.isUpsidedown();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isUpsidedown`](../../entity/interfaces/EntityMp.md#isupsidedown)

***

### isVisible()

> **isVisible**(): `Promise`\<`boolean`\>

Whether the entity is visible.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Remarks

Asynchronous: the value is read from the game when the Promise is awaited.

#### Example

```ts
const shown = await player.isVisible();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isVisible`](../../entity/interfaces/EntityMp.md#isvisible)

***

### isVisibleToScript()

> **isVisibleToScript**(): `Promise`\<`boolean`\>

Whether the entity is visible to scripts, as the game reports it.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const shown = await entity.isVisibleToScript();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isVisibleToScript`](../../entity/interfaces/EntityMp.md#isvisibletoscript)

***

### isWaitingForWorldCollision()

> **isWaitingForWorldCollision**(): `Promise`\<`boolean`\>

Whether the entity is still waiting for the collision of the world around it to load.

#### Returns

`Promise`\<`boolean`\>

A Promise of true or false.

#### Example

```ts
const waiting = await vehicle.isWaitingForWorldCollision();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`isWaitingForWorldCollision`](../../entity/interfaces/EntityMp.md#iswaitingforworldcollision)

***

### isWindowIntact()

> **isWindowIntact**(`windowIndex`): `Promise`\<`boolean`\>

Whether a window is intact.

#### Parameters

##### windowIndex

`number`

The window's index, in the game's numbering.

#### Returns

`Promise`\<`boolean`\>

A Promise of the answer.

#### Remarks

Asynchronous.

#### Example

```ts
const whole = await car.isWindowIntact(0);
```

***

### lowerConvertibleRoof()

> **lowerConvertibleRoof**(`instantlyLower`): `void`

Lowers the vehicle's convertible roof.

#### Parameters

##### instantlyLower

`boolean`

`true` to lower it at once.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.lowerConvertibleRoof(false);
```

***

### removeWindow()

> **removeWindow**(`windowIndex`): `void`

Removes one window from the vehicle.

#### Parameters

##### windowIndex

`number`

The window's index, in the game's numbering.

#### Returns

`void`

#### Example

```ts
car.removeWindow(0);
```

***

### requestHighDetailModel()

> **requestHighDetailModel**(): `void`

Asks the game to load the vehicle's high-detail model.

#### Returns

`void`

#### Example

```ts
car.requestHighDetailModel();
```

***

### resetAlpha()

> **resetAlpha**(): `void`

Restores the entity's opacity to the default.

#### Returns

`void`

#### Example

```ts
player.resetAlpha();
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`resetAlpha`](../../entity/interfaces/EntityMp.md#resetalpha)

***

### resetStuckTimer()

> **resetStuckTimer**(`reset`): `void`

Resets the vehicle's stuck timer.

#### Parameters

##### reset

`boolean`

True to reset it.

#### Returns

`void`

#### Example

```ts
car.resetStuckTimer(true);
```

***

### resetWheels()

> **resetWheels**(`toggle`): `void`

Puts the vehicle's wheels back in their places.

#### Parameters

##### toggle

`boolean`

Passed to the game as it is.

#### Returns

`void`

#### Example

```ts
car.resetWheels(true);
```

***

### rollDownWindow()

> **rollDownWindow**(`windowIndex`): `void`

Rolls down one window.

#### Parameters

##### windowIndex

`number`

The window's index, in the game's numbering.

#### Returns

`void`

#### Example

```ts
car.rollDownWindow(0);
```

***

### rollDownWindows()

> **rollDownWindows**(): `void`

Rolls down all the vehicle's windows.

#### Returns

`void`

#### Example

```ts
car.rollDownWindows();
```

***

### rollUpWindow()

> **rollUpWindow**(`windowIndex`): `void`

Rolls up one window.

#### Parameters

##### windowIndex

`number`

The window's index, in the game's numbering.

#### Returns

`void`

#### Example

```ts
car.rollUpWindow(0);
```

***

### setAlarm()

> **setAlarm**(`state`): `void`

Sets the vehicle's alarm.

#### Parameters

##### state

`boolean`

True to turn the alarm on.

#### Returns

`void`

#### Example

```ts
car.setAlarm(true);
```

***

### setAlpha()

> **setAlpha**(`alpha`): `void`

Sets the entity's opacity.

#### Parameters

##### alpha

`number`

0 (invisible) to 255 (opaque); the game clamps other values.

#### Returns

`void`

#### Remarks

Works on every entity kind and updates the `alpha` property. On a player the game's second flag is always
false. Changes the game's copy on this client only. A vehicle the game does not show yet (handle 0) rejects.

#### Example

```ts
player.setAlpha(128);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setAlpha`](../../entity/interfaces/EntityMp.md#setalpha)

***

### setAsMission()

> **setAsMission**(`scriptObject`, `byThisScript`): `void`

Makes the entity a mission entity, which the game keeps while the script runs.

#### Parameters

##### scriptObject

`boolean`

The game's first flag.

##### byThisScript

`boolean`

The game's second flag.

#### Returns

`void`

#### Remarks

The call does nothing on the entities the client owns today (the local player, other players, server
peds, vehicles and objects): their lifetime belongs to SixL, and giving it to the game could free them while they
are still in use. A warning is written to the console once. Entities created by the client will honour it later.

#### Example

```ts
entity.setAsMission(true, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setAsMission`](../../entity/interfaces/EntityMp.md#setasmission)

***

### setAutomaticallyAttaches()

> **setAutomaticallyAttaches**(`autoAttach`, `scanDriver`): `void`

Turns the automatic attaching of the vehicle to trailers and tow trucks on or off.

#### Parameters

##### autoAttach

`boolean`

True to let the vehicle attach by itself.

##### scanDriver

`boolean`

Passed to the game as it is: whether the driver is checked too.

#### Returns

`void`

#### Example

```ts
truck.setAutomaticallyAttaches(true, false);
```

***

### setBoatAnchor()

> **setBoatAnchor**(`toggle`): `void`

Sets the boat's anchor.

#### Parameters

##### toggle

`boolean`

True to lower the anchor.

#### Returns

`void`

#### Example

```ts
boat.setBoatAnchor(true);
```

***

### setBodyHealth()

> **setBodyHealth**(`value`): `void`

Sets the vehicle's body health.

#### Parameters

##### value

`number`

The health, on the game's scale (a new vehicle starts at 1000).

#### Returns

`void`

#### Example

```ts
car.setBodyHealth(1000);
```

***

### setBurnout()

> **setBurnout**(`toggle`): `void`

Turns the burnout on or off.

#### Parameters

##### toggle

`boolean`

True to start the burnout.

#### Returns

`void`

#### Example

```ts
car.setBurnout(true);
```

***

### setCanBeDamaged()

> **setCanBeDamaged**(`toggle`): `void`

Lets the entity take damage or makes it invulnerable to it.

#### Parameters

##### toggle

`boolean`

True to allow damage, false to block it.

#### Returns

`void`

#### Example

```ts
vehicle.setCanBeDamaged(false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCanBeDamaged`](../../entity/interfaces/EntityMp.md#setcanbedamaged)

***

### setCanBeDamagedByRelationshipGroup()

> **setCanBeDamagedByRelationshipGroup**(`toggle`, `group`): `void`

Sets whether a relationship group can damage the entity.

#### Parameters

##### toggle

`boolean`

True to allow the group's damage, false to block it.

##### group

`string` \| `number`

The relationship group's name (hashed when a string) or its hash.

#### Returns

`void`

#### Example

```ts
ped.setCanBeDamagedByRelationshipGroup(false, 'police');
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCanBeDamagedByRelationshipGroup`](../../entity/interfaces/EntityMp.md#setcanbedamagedbyrelationshipgroup)

***

### setCanBeTargetedWithoutLos()

> **setCanBeTargetedWithoutLos**(`toggle`): `void`

Lets the entity be targeted when it is not in line of sight.

#### Parameters

##### toggle

`boolean`

True to allow targeting without line of sight.

#### Returns

`void`

#### Example

```ts
ped.setCanBeTargetedWithoutLos(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCanBeTargetedWithoutLos`](../../entity/interfaces/EntityMp.md#setcanbetargetedwithoutlos)

***

### setCanBeTargetted()

> **setCanBeTargetted**(`state`): `void`

Sets whether the vehicle can be targeted.

#### Parameters

##### state

`boolean`

True if it can be targeted.

#### Returns

`void`

#### Example

```ts
car.setCanBeTargetted(false);
```

***

### setCanBeUsedByFleeingPeds()

> **setCanBeUsedByFleeingPeds**(`toggle`): `void`

Sets whether fleeing peds can use the vehicle.

#### Parameters

##### toggle

`boolean`

True to let them use it.

#### Returns

`void`

#### Example

```ts
car.setCanBeUsedByFleeingPeds(false);
```

***

### setCanBeVisiblyDamaged()

> **setCanBeVisiblyDamaged**(`state`): `void`

Sets whether the vehicle can be visibly damaged.

#### Parameters

##### state

`boolean`

True to allow visible damage.

#### Returns

`void`

#### Example

```ts
car.setCanBeVisiblyDamaged(true);
```

***

### setCanBreak()

> **setCanBreak**(`toggle`): `void`

Sets whether the vehicle can break.

#### Parameters

##### toggle

`boolean`

True to allow it to break.

#### Returns

`void`

#### Example

```ts
car.setCanBreak(true);
```

***

### setCollision()

> **setCollision**(`toggle`, `keepPhysics`): `void`

Turns the entity's collision on or off.

#### Parameters

##### toggle

`boolean`

True to turn collision on, false to turn it off.

##### keepPhysics

`boolean`

True to keep the physics while the collision is off.

#### Returns

`void`

#### Example

```ts
vehicle.setCollision(false, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCollision`](../../entity/interfaces/EntityMp.md#setcollision)

***

### setCoords()

> **setCoords**(`x`, `y`, `z`, `xAxis`, `yAxis`, `zAxis`, `clearArea`): `void`

Moves the entity to a position (a teleport).

#### Parameters

##### x

`number`

The x coordinate.

##### y

`number`

The y coordinate.

##### z

`number`

The z coordinate.

##### xAxis

`boolean`

Passed to the game as it is.

##### yAxis

`boolean`

Passed to the game as it is.

##### zAxis

`boolean`

Passed to the game as it is.

##### clearArea

`boolean`

Passed to the game as it is: whether to clear the area around the new position.

#### Returns

`void`

#### Remarks

A change to this client's game copy of the entity: for a server entity the server's next sync puts it back.
The local player is moved like `position = v`. A ped that is not the local player (a server ped, another player) takes
at most one move per frame: a second call in the same frame is held and sent on the next frame, the latest one wins.

#### Example

```ts
vehicle.setCoords(-1190, -115, 6, false, false, false, true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCoords`](../../entity/interfaces/EntityMp.md#setcoords)

***

### setCoords2()

> **setCoords2**(`x`, `y`, `z`, `xAxis`, `yAxis`, `zAxis`, `clearArea`): `void`

Moves the entity to a position, with the axis flags as numbers.

#### Parameters

##### x

`number`

The x coordinate.

##### y

`number`

The y coordinate.

##### z

`number`

The z coordinate.

##### xAxis

`number`

Passed to the game as it is: 0 is off, any other number on.

##### yAxis

`number`

As `xAxis`.

##### zAxis

`number`

As `xAxis`.

##### clearArea

`boolean`

Whether to clear the area around the new position.

#### Returns

`void`

#### Remarks

The same move as [EntityMp.setCoords](../../entity/interfaces/EntityMp.md#setcoords), with the same one-move-per-frame rule for peds.

#### Example

```ts
object.setCoords2(-1186, -112, 6, 0, 0, 0, false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCoords2`](../../entity/interfaces/EntityMp.md#setcoords2)

***

### setCoordsNoOffset()

> **setCoordsNoOffset**(`x`, `y`, `z`, `xAxis`, `yAxis`, `zAxis`): `void`

Moves the entity to a position without the game's offset correction.

#### Parameters

##### x

`number`

The x coordinate.

##### y

`number`

The y coordinate.

##### z

`number`

The z coordinate.

##### xAxis

`boolean`

Passed to the game as it is.

##### yAxis

`boolean`

Passed to the game as it is.

##### zAxis

`boolean`

Passed to the game as it is.

#### Returns

`void`

#### Remarks

Same rules as [EntityMp.setCoords](../../entity/interfaces/EntityMp.md#setcoords), including the one-move-per-frame rule for peds.

#### Example

```ts
object.setCoordsNoOffset(-1186, -112, 6, false, false, false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setCoordsNoOffset`](../../entity/interfaces/EntityMp.md#setcoordsnooffset)

***

### setDirtLevel()

> **setDirtLevel**(`dirtLevel`): `void`

Sets the vehicle's dirt level, as the game's number (no conversion).

#### Parameters

##### dirtLevel

`number`

The dirt level, in the game's scale.

#### Returns

`void`

#### Example

```ts
car.setDirtLevel(0);
```

***

### setDoorBroken()

> **setDoorBroken**(`doorIndex`, `createDoorObject`): `void`

Breaks a door off the vehicle.

#### Parameters

##### doorIndex

`number`

The door's index, in the game's numbering.

##### createDoorObject

`boolean`

Passed to the game as it is: whether a loose door object is made.

#### Returns

`void`

#### Example

```ts
car.setDoorBroken(0, true);
```

***

### setDoorControl()

> **setDoorControl**(`doorIndex`, `speed`, `angle`): `void`

Moves a door towards an angle at a speed.

#### Parameters

##### doorIndex

`number`

The door's index, in the game's numbering.

##### speed

`number`

The speed of the movement.

##### angle

`number`

The angle to move the door to.

#### Returns

`void`

#### Remarks

The speed is sent as a whole number: fractions are cut off. The angle is sent as a decimal.

#### Example

```ts
car.setDoorControl(0, 1, 0.5);
```

***

### setDoorLatched()

> **setDoorLatched**(`doorIndex`, `toggle`, `autoLatch`, `applyForce`): `void`

Latches or unlatches a door.

#### Parameters

##### doorIndex

`number`

The door's index, in the game's numbering.

##### toggle

`boolean`

True to latch the door.

##### autoLatch

`boolean`

Passed to the game as it is: whether the door latches by itself.

##### applyForce

`boolean`

Passed to the game as it is: whether force is applied.

#### Returns

`void`

#### Example

```ts
car.setDoorLatched(0, true, false, false);
```

***

### setDoorOpen()

> **setDoorOpen**(`doorIndex`, `loose`, `openInstantly`): `void`

Opens a door.

#### Parameters

##### doorIndex

`number`

The door's index, in the game's numbering.

##### loose

`boolean`

Passed to the game as it is: whether the door is left loose.

##### openInstantly

`boolean`

True to open it at once, without animation.

#### Returns

`void`

#### Example

```ts
car.setDoorOpen(0, false, true);
```

***

### setDoorShut()

> **setDoorShut**(`doorIndex`, `closeInstantly`): `void`

Shuts a door.

#### Parameters

##### doorIndex

`number`

The door's index, in the game's numbering.

##### closeInstantly

`boolean`

True to shut it at once, without animation.

#### Returns

`void`

#### Example

```ts
car.setDoorShut(0, true);
```

***

### setDoorsLocked()

> **setDoorsLocked**(`doorLockStatus`): `void`

Sets the vehicle's door lock status.

#### Parameters

##### doorLockStatus

`number`

The status, as the game's number.

#### Returns

`void`

#### Example

```ts
car.setDoorsLocked(2);
```

***

### setDoorsLockedForAllPlayers()

> **setDoorsLockedForAllPlayers**(`toggle`): `void`

Locks or unlocks the doors for every player.

#### Parameters

##### toggle

`boolean`

True to lock them.

#### Returns

`void`

#### Example

```ts
car.setDoorsLockedForAllPlayers(true);
```

***

### setDoorsShut()

> **setDoorsShut**(`closeInstantly`): `void`

Shuts all the vehicle's doors.

#### Parameters

##### closeInstantly

`boolean`

True to shut them at once, without animation.

#### Returns

`void`

#### Example

```ts
car.setDoorsShut(true);
```

***

### setDynamic()

> **setDynamic**(`toggle`): `void`

Makes the entity dynamic (moved by physics) or static.

#### Parameters

##### toggle

`boolean`

True for dynamic, false for static.

#### Returns

`void`

#### Example

```ts
object.setDynamic(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setDynamic`](../../entity/interfaces/EntityMp.md#setdynamic)

***

### setEngineCanDegrade()

> **setEngineCanDegrade**(`toggle`): `void`

Sets whether the engine can degrade.

#### Parameters

##### toggle

`boolean`

True to let the engine degrade.

#### Returns

`void`

#### Example

```ts
car.setEngineCanDegrade(true);
```

***

### setEngineHealth()

> **setEngineHealth**(`health`): `void`

Sets the vehicle's engine health, on the 0..1000 scale (1000 is undamaged).

#### Parameters

##### health

`number`

The health (a new vehicle starts at 1000).

#### Returns

`void`

#### Example

```ts
car.setEngineHealth(1000);
```

***

### setEngineOn()

> **setEngineOn**(`value`, `instantly`, `otherwise`): `void`

Turns the engine on or off.

#### Parameters

##### value

`boolean`

True to run the engine.

##### instantly

`boolean`

True to change the state at once, without the start-up.

##### otherwise

`boolean`

Passed to the game as it is: the state used when the vehicle has no driver.

#### Returns

`void`

#### Example

```ts
car.setEngineOn(true, true, false);
```

***

### setExclusiveDriver()

> **setExclusiveDriver**(`ped`, `driverIndex`): `void`

Makes one ped the exclusive driver of a seat.

#### Parameters

##### ped

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The ped (an entity) that is allowed to drive.

##### driverIndex

`number`

The seat's index, in the game's numbering.

#### Returns

`void`

#### Example

```ts
car.setExclusiveDriver(ped, -1);
```

***

### setExplodesOnHighExplosionDamage()

> **setExplodesOnHighExplosionDamage**(`toggle`): `void`

Sets whether the vehicle explodes when it takes high explosion damage.

#### Parameters

##### toggle

`boolean`

True to let it explode.

#### Returns

`void`

#### Example

```ts
car.setExplodesOnHighExplosionDamage(true);
```

***

### setFixed()

> **setFixed**(): `void`

Repairs the vehicle.

#### Returns

`void`

#### Example

```ts
car.setFixed();
```

***

### setForwardSpeed()

> **setForwardSpeed**(`speed`): `void`

Sets the vehicle's forward speed.

#### Parameters

##### speed

`number`

The speed, as the game takes it (no conversion).

#### Returns

`void`

#### Remarks

The speed is sent as a whole number: fractions are cut off. The game's unit is not stated here.

#### Example

```ts
car.setForwardSpeed(10);
```

***

### setFrictionOverride()

> **setFrictionOverride**(`friction`): `void`

Overrides the friction of the vehicle's tyres.

#### Parameters

##### friction

`number`

The friction, as the game takes it (no conversion).

#### Returns

`void`

#### Example

```ts
car.setFrictionOverride(0.5);
```

***

### setFullbeam()

> **setFullbeam**(`toggle`): `void`

Turns the full beam of the headlights on or off.

#### Parameters

##### toggle

`boolean`

True for the full beam.

#### Returns

`void`

#### Example

```ts
car.setFullbeam(true);
```

***

### setGravity()

> **setGravity**(`toggle`): `void`

Turns gravity on or off for the vehicle.

#### Parameters

##### toggle

`boolean`

True to keep gravity.

#### Returns

`void`

#### Example

```ts
car.setGravity(false);
```

***

### setHalt()

> **setHalt**(`distance`, `killEngine`, `unknown`): `void`

Brings the vehicle to a halt.

#### Parameters

##### distance

`number`

The distance to stop within, in metres.

##### killEngine

`number`

How long it stays halted, as the game takes it.

##### unknown

`boolean`

Passed to the game as it is.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.setHalt(5, 1, false);
```

***

### setHandbrake()

> **setHandbrake**(`toggle`): `void`

Sets the handbrake.

#### Parameters

##### toggle

`boolean`

True to pull it.

#### Returns

`void`

#### Example

```ts
car.setHandbrake(true);
```

***

### setHasBeenOwnedByPlayer()

> **setHasBeenOwnedByPlayer**(`owned`): `void`

Sets whether the vehicle counts as one that a player has owned.

#### Parameters

##### owned

`boolean`

True if it has been owned by a player.

#### Returns

`void`

#### Example

```ts
car.setHasBeenOwnedByPlayer(true);
```

***

### setHasGravity()

> **setHasGravity**(`toggle`): `void`

Turns the entity's gravity on or off.

#### Parameters

##### toggle

`boolean`

True for gravity, false for none.

#### Returns

`void`

#### Example

```ts
object.setHasGravity(false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setHasGravity`](../../entity/interfaces/EntityMp.md#sethasgravity)

***

### setHasStrongAxles()

> **setHasStrongAxles**(`toggle`): `void`

Sets whether the vehicle has strong axles.

#### Parameters

##### toggle

`boolean`

True for strong axles.

#### Returns

`void`

#### Example

```ts
car.setHasStrongAxles(true);
```

***

### setHeading()

> **setHeading**(`heading`): `void`

Sets the entity's heading: the direction it faces, counter-clockwise from north.

#### Parameters

##### heading

`number`

The heading in degrees; converted for the game.

#### Returns

`void`

#### Remarks

Players (their own and the others') take the value at once; other entities pass it on to the game.

#### Example

```ts
player.setHeading(90);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setHeading`](../../entity/interfaces/EntityMp.md#setheading)

***

### setHealth()

> **setHealth**(`health`): `void`

Sets the entity's health, in the game's hit-point scale.

#### Parameters

##### health

`number`

The new health.

#### Returns

`void`

#### Remarks

Works on every kind of entity. The killer is left empty and the two flags are 0. On a vehicle it sets the
body health, 0 to 1000 (the value is clamped). The change is on this client's game copy of the entity only; it is
not sent to the server.

#### Example

```ts
player.setHealth(100);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setHealth`](../../entity/interfaces/EntityMp.md#sethealth)

***

### setHornEnabled()

> **setHornEnabled**(`enable`): `void`

Turns the vehicle's horn on or off.

#### Parameters

##### enable

`boolean`

`true` to let it sound.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.setHornEnabled(false);
```

***

### setIndicatorLights()

> **setIndicatorLights**(`turnSignal`, `toggle`): `void`

Turns a turn signal on or off.

#### Parameters

##### turnSignal

`number`

The signal's index, in the game's numbering.

##### toggle

`boolean`

True to turn it on.

#### Returns

`void`

#### Remarks

Partial: the signal index is sent as a flag (any non-zero index counts as true).

#### Example

```ts
car.setIndicatorLights(0, true);
```

***

### setInteriorlight()

> **setInteriorlight**(`toggle`): `void`

Turns the interior light on or off.

#### Parameters

##### toggle

`boolean`

True to turn it on.

#### Returns

`void`

#### Example

```ts
car.setInteriorlight(true);
```

***

### setInvincible()

> **setInvincible**(`toggle`): `void`

Makes the entity invincible or not.

#### Parameters

##### toggle

`boolean`

True for invincible, false to take damage.

#### Returns

`void`

#### Example

```ts
player.setInvincible(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setInvincible`](../../entity/interfaces/EntityMp.md#setinvincible)

***

### setIsConsideredByPlayer()

> **setIsConsideredByPlayer**(`toggle`): `void`

Sets the game's flag for whether players consider the vehicle.

#### Parameters

##### toggle

`boolean`

True to set the flag.

#### Returns

`void`

#### Example

```ts
car.setIsConsideredByPlayer(true);
```

***

### setIsStolen()

> **setIsStolen**(`isStolen`): `void`

Sets whether the vehicle is flagged as stolen.

#### Parameters

##### isStolen

`boolean`

True to flag it.

#### Returns

`void`

#### Example

```ts
car.setIsStolen(true);
```

***

### setIsTargetPriority()

> **setIsTargetPriority**(`toggle`, `distance?`): `void`

Gives the entity priority as a target.

#### Parameters

##### toggle

`boolean`

True to give priority.

##### distance?

`number`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`void`

#### Example

```ts
ped.setIsTargetPriority(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setIsTargetPriority`](../../entity/interfaces/EntityMp.md#setistargetpriority)

***

### setLightMultiplier()

> **setLightMultiplier**(`multiplier`): `void`

Sets the light multiplier of the vehicle.

#### Parameters

##### multiplier

`number`

The multiplier.

#### Returns

`void`

#### Remarks

Partial: the multiplier is sent as a flag (any non-zero value counts as true), so the game does not
receive a multiplier value yet.

#### Example

```ts
car.setLightMultiplier(2);
```

***

### setLights()

> **setLights**(`state`): `void`

Sets the vehicle's lights.

#### Parameters

##### state

`number` \| `boolean`

The lights' state: a number, or a flag (true is 1).

#### Returns

`void`

#### Example

```ts
car.setLights(1);
```

***

### setLoadCollisionFlag()

> **setLoadCollisionFlag**(`toggle`): `void`

Sets whether the collision of the entity is loaded from the world.

#### Parameters

##### toggle

`boolean`

True to load it.

#### Returns

`void`

#### Example

```ts
vehicle.setLoadCollisionFlag(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setLoadCollisionFlag`](../../entity/interfaces/EntityMp.md#setloadcollisionflag)

***

### setLodDist()

> **setLodDist**(`distance`): `void`

Sets the distance at which the entity switches to its less detailed model.

#### Parameters

##### distance

`number`

The distance in metres.

#### Returns

`void`

#### Example

```ts
object.setLodDist(200);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setLodDist`](../../entity/interfaces/EntityMp.md#setloddist)

***

### setLodMultiplier()

> **setLodMultiplier**(`multiplier`): `void`

Sets the level-of-detail multiplier of the vehicle's model.

#### Parameters

##### multiplier

`number`

The multiplier, as the game takes it (no conversion).

#### Returns

`void`

#### Example

```ts
car.setLodMultiplier(1);
```

***

### setMaxHealth()

> **setMaxHealth**(`health`): `void`

Sets the entity's maximum health, in the game's hit-point scale.

#### Parameters

##### health

`number`

The maximum health.

#### Returns

`void`

#### Remarks

Players and peds use the ped's own maximum health; vehicles and objects use the entity's. On the local player VI keeps the maximum at 200 whatever is set (a VI difference from RAGE MP).

#### Example

```ts
ped.setMaxHealth(200);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setMaxHealth`](../../entity/interfaces/EntityMp.md#setmaxhealth)

***

### setMaxSpeed()

> **setMaxSpeed**(`speed`): `void`

Sets the entity's maximum speed.

#### Parameters

##### speed

`number`

The maximum speed in metres per second.

#### Returns

`void`

#### Example

```ts
vehicle.setMaxSpeed(30);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setMaxSpeed`](../../entity/interfaces/EntityMp.md#setmaxspeed)

***

### setModKit()

> **setModKit**(`modKit`): `void`

Sets the vehicle's mod kit.

#### Parameters

##### modKit

`number`

The mod kit's index, in the game's numbering.

#### Returns

`void`

#### Example

```ts
car.setModKit(0);
```

***

### setNeedsToBeHotwired()

> **setNeedsToBeHotwired**(`toggle`): `void`

Sets whether the vehicle must be hotwired to start.

#### Parameters

##### toggle

`boolean`

`true` to need it.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.setNeedsToBeHotwired(false);
```

***

### setNoCollision()

> **setNoCollision**(`entity`, `collision`): `void`

Stops the entity and another entity from colliding with each other.

#### Parameters

##### entity

`number` \| [`EntityMp`](../../entity/interfaces/EntityMp.md)

The other entity (an entity object or its handle).

##### collision

`boolean`

Passed to the game as its own flag for the pair.

#### Returns

`void`

#### Example

```ts
prop.setNoCollision(vehicle, true);
```

#### Remarks

The change is between this pair only and local to this client. For a server entity the server's next
sync wins.

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setNoCollision`](../../entity/interfaces/EntityMp.md#setnocollision)

***

### setOnGroundProperly()

> **setOnGroundProperly**(): `Promise`\<`boolean`\>

Puts the vehicle on the ground, the way the game does it, and reports the game's answer.

#### Returns

`Promise`\<`boolean`\>

A Promise of the game's answer.

#### Remarks

Asynchronous. Takes no argument: the game's extra flag is always sent as false.

#### Example

```ts
const placed = await car.setOnGroundProperly();
```

***

### setOnlyDamagedByPlayer()

> **setOnlyDamagedByPlayer**(`toggle`): `void`

Makes the entity take damage only from the player (not from the world or other entities).

#### Parameters

##### toggle

`boolean`

True to take damage only from players.

#### Returns

`void`

#### Example

```ts
vehicle.setOnlyDamagedByPlayer(true);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setOnlyDamagedByPlayer`](../../entity/interfaces/EntityMp.md#setonlydamagedbyplayer)

***

### setOnlyDamagedByRelationshipGroup()

> **setOnlyDamagedByRelationshipGroup**(`toggle`, `group`): `void`

Makes the entity take damage only from one relationship group.

#### Parameters

##### toggle

`boolean`

True to take damage only from the group.

##### group

`string` \| `number`

The relationship group's name (hashed when a string) or its hash.

#### Returns

`void`

#### Example

```ts
ped.setOnlyDamagedByRelationshipGroup(true, 'police');
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setOnlyDamagedByRelationshipGroup`](../../entity/interfaces/EntityMp.md#setonlydamagedbyrelationshipgroup)

***

### setOutOfControl()

> **setOutOfControl**(`killDriver`, `explodeOnImpact`): `void`

Takes control of the vehicle away from its driver.

#### Parameters

##### killDriver

`boolean`

True to kill the driver.

##### explodeOnImpact

`boolean`

True to explode on impact.

#### Returns

`void`

#### Example

```ts
car.setOutOfControl(false, false);
```

***

### setPetrolTankHealth()

> **setPetrolTankHealth**(`fix`): `void`

Sets the petrol tank's health, on the 0..1000 scale (1000 is undamaged).

#### Parameters

##### fix

`number`

The health, as the game takes it.

#### Returns

`void`

#### Example

```ts
car.setPetrolTankHealth(1000);
```

***

### setProofs()

> **setProofs**(`bulletProof`, `fireProof`, `explosionProof`, `collisionProof`, `meleeProof`, `p5`, `p6`, `drownProof`): `void`

Makes the entity immune to some kinds of damage.

#### Parameters

##### bulletProof

`boolean`

True to ignore bullets.

##### fireProof

`boolean`

True to ignore fire.

##### explosionProof

`boolean`

True to ignore explosions.

##### collisionProof

`boolean`

True to ignore collisions.

##### meleeProof

`boolean`

True to ignore melee hits.

##### p5

`boolean`

The game's next flag, passed on as it is.

##### p6

`boolean`

The game's next flag, passed on as it is.

##### drownProof

`boolean`

True to ignore drowning.

#### Returns

`void`

#### Remarks

Works on every kind of entity; the eight flags go to the game in this order. The change is on this
client's game copy of the entity only. Pass all `false` to restore the entity.

#### Example

```ts
ped.setProofs(true, true, true, false, false, false, false, false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setProofs`](../../entity/interfaces/EntityMp.md#setproofs)

***

### setProvidesCover()

> **setProvidesCover**(`toggle`): `void`

Sets whether the vehicle gives cover.

#### Parameters

##### toggle

`boolean`

`true` to give cover.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.setProvidesCover(true);
```

***

### setQuaternion()

> **setQuaternion**(`x`, `y`, `z`, `w`): `void`

Turns the entity to a rotation given as a quaternion.

#### Parameters

##### x

`number`

The quaternion's x.

##### y

`number`

The quaternion's y.

##### z

`number`

The quaternion's z.

##### w

`number`

The quaternion's w; the four numbers are normalised first.

#### Returns

`void`

#### Remarks

The game has no setter for it here: the quaternion is turned into pitch, roll and yaw (rotation order 2, yaw
about z first) and set like [EntityMp.setRotation](../../entity/interfaces/EntityMp.md#setrotation). A quaternion read with `getQuaternion` and set back gives the
same pose.

#### Example

```ts
object.setQuaternion(0, 0, 0.7071068, 0.7071068);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setQuaternion`](../../entity/interfaces/EntityMp.md#setquaternion)

***

### setRotation()

> **setRotation**(`pitch`, `roll`, `yaw`, `order?`, `p5?`): `void`

Sets the entity's rotation, in degrees.

#### Parameters

##### pitch

`number`

Rotation around x, degrees.

##### roll

`number`

Rotation around y, degrees.

##### yaw

`number`

Rotation around z, degrees.

##### order?

`number`

The rotation order the game uses; 2 when omitted.

##### p5?

`boolean`

Passed to the game as its flag.

#### Returns

`void`

#### Example

```ts
object.setRotation(0, 0, 90, 2, false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setRotation`](../../entity/interfaces/EntityMp.md#setrotation)

***

### setSirenWithNoDriver()

> **setSirenWithNoDriver**(`enable`): `void`

Lets the vehicle's siren run with no driver, or stops it.

#### Parameters

##### enable

`boolean`

`true` to let it run.

#### Returns

`void`

#### Remarks

Partial: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.setSirenWithNoDriver(true);
```

***

### setSteerBias()

> **setSteerBias**(`value`): `void`

Sets the vehicle's steering bias.

#### Parameters

##### value

`number`

The bias, as the game takes it (no conversion).

#### Returns

`void`

#### Example

```ts
car.setSteerBias(0);
```

***

### setStrong()

> **setStrong**(`toggle`): `void`

Sets whether the vehicle is strong (hard to damage).

#### Parameters

##### toggle

`boolean`

True for strong.

#### Returns

`void`

#### Example

```ts
car.setStrong(true);
```

***

### setTrainCruiseSpeed()

> **setTrainCruiseSpeed**(`speed`): `void`

Sets the cruise speed of a train.

#### Parameters

##### speed

`number`

The speed, as the game takes it (no conversion).

#### Returns

`void`

#### Example

```ts
train.setTrainCruiseSpeed(10);
```

***

### setTrainSpeed()

> **setTrainSpeed**(`speed`): `void`

Sets the speed of a train.

#### Parameters

##### speed

`number`

The speed, as the game takes it (no conversion).

#### Returns

`void`

#### Example

```ts
train.setTrainSpeed(10);
```

***

### setTyreBurst()

> **setTyreBurst**(`tyreIndex`, `instantBurst`, `damage`): `void`

Bursts a tyre.

#### Parameters

##### tyreIndex

`number`

The tyre's index, in the game's numbering.

##### instantBurst

`boolean`

True to burst it at once.

##### damage

`number`

The damage, as the game takes it (no conversion).

#### Returns

`void`

#### Example

```ts
car.setTyreBurst(0, true, 1000);
```

***

### setTyreFixed()

> **setTyreFixed**(`tyreIndex`): `void`

Repairs a burst tyre.

#### Parameters

##### tyreIndex

`number`

The tyre's index, in the game's numbering.

#### Returns

`void`

#### Example

```ts
car.setTyreFixed(0);
```

***

### setTyresCanBurst()

> **setTyresCanBurst**(`toggle`): `void`

Sets whether the tyres can burst.

#### Parameters

##### toggle

`boolean`

True to let them burst.

#### Returns

`void`

#### Example

```ts
car.setTyresCanBurst(true);
```

***

### setUndriveable()

> **setUndriveable**(`toggle`): `void`

Sets whether the vehicle is undriveable.

#### Parameters

##### toggle

`boolean`

True to make it undriveable.

#### Returns

`void`

#### Example

```ts
car.setUndriveable(false);
```

***

### setVelocity()

> **setVelocity**(`x`, `y`, `z`): `void`

Sets the entity's velocity.

#### Parameters

##### x

`number`

Velocity along x, metres per second.

##### y

`number`

Velocity along y, metres per second.

##### z

`number`

Velocity along z, metres per second.

#### Returns

`void`

#### Example

```ts
vehicle.setVelocity(0, 10, 0);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setVelocity`](../../entity/interfaces/EntityMp.md#setvelocity)

***

### setVisible()

> **setVisible**(`toggle`, `p1?`): `void`

Shows or hides the entity.

#### Parameters

##### toggle

`boolean`

True to show the entity, false to hide it.

##### p1?

`boolean`

Accepted for RAGE MP compatibility; ignored.

#### Returns

`void`

#### Remarks

Works on every entity kind. Changes the game's copy on this client only.

#### Example

```ts
player.setVisible(false);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`setVisible`](../../entity/interfaces/EntityMp.md#setvisible)

***

### setWheelsCanBreak()

> **setWheelsCanBreak**(`enabled`): `void`

Sets whether the wheels can break.

#### Parameters

##### enabled

`boolean`

True to allow it.

#### Returns

`void`

#### Example

```ts
car.setWheelsCanBreak(true);
```

***

### setWheelsCanBreakOffWhenBlowUp()

> **setWheelsCanBreakOffWhenBlowUp**(`toggle`): `void`

Sets whether the wheels can break off when the vehicle blows up.

#### Parameters

##### toggle

`boolean`

True to allow it.

#### Returns

`void`

#### Example

```ts
car.setWheelsCanBreakOffWhenBlowUp(true);
```

***

### smashWindow()

> **smashWindow**(`index`): `void`

Smashes a window of the vehicle.

#### Parameters

##### index

`number`

The window, as the game numbers it.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.smashWindow(0);
```

***

### startAlarm()

> **startAlarm**(): `void`

Starts the vehicle's alarm.

#### Returns

`void`

#### Remarks

Partial: the game's call is an unnamed one that is only a candidate: not yet confirmed in the game. On a server vehicle the server's state may put it back: the change is made in this client's game only.

#### Example

```ts
vehicle.startAlarm();
```

***

### stopAnim()

> **stopAnim**(`animation`, `group`, `blend`): `void`

Stops an animation that plays on the entity.

#### Parameters

##### animation

`string` \| `number`

The animation's name (hashed when a string) or its hash.

##### group

`string` \| `number`

The animation dictionary's name (hashed when a string) or its hash.

##### blend

`number`

A float passed to the game as is.

#### Returns

`void`

#### Example

```ts
ped.stopAnim('walk', 'move_m@', 0.5);
```

#### Inherited from

[`EntityMp`](../../entity/interfaces/EntityMp.md).[`stopAnim`](../../entity/interfaces/EntityMp.md#stopanim)

***

### trackVisibility()

> **trackVisibility**(): `void`

Asks the game to track the vehicle's visibility.

#### Returns

`void`

#### Example

```ts
car.trackVisibility();
```
