SixL client API / ped / PedMpBase

Interface: PedMpBase

What a ped has: the entity members (EntityMp) and the members below. A streamed ped (PedMp) and the local player (PlayerMp, mp.players.local) both have them, with the differences stated in each member's remarks.

Remarks

A streamed ped has only the members listed here; a member the client does not implement for it is not declared.

Example

const armour = mp.players.local.getArmour();

Extends

Extended by

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

vehicle.alpha = 128;

Inherited from

EntityMp.alpha


data

data: object

The entity's shared variables as an object: the same values EntityMp.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

const job = player.data.job;

Inherited from

EntityMp.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

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

Inherited from

EntityMp.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, 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

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

Inherited from

EntityMp.handle


heading

heading: number

The ped's heading, in degrees.

Remarks

Partial. On the local player it is the live heading, 0..360 counter-clockwise from north, and it is read-only. On a streamed ped it is the heading the server put the ped at on stream-in, in degrees, and a script's assignment changes only that copy: the game ped is not turned.

Example

const h = mp.players.local.heading;

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

const slot = player.id;

Inherited from

EntityMp.id


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.

Example

const model = vehicle.model;

Inherited from

EntityMp.model


position

position: Vector3

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 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

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

Inherited from

EntityMp.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

const serverId = player.remoteId;

Inherited from

EntityMp.remoteId


rotation

rotation: Vector3

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) 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

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

Inherited from

EntityMp.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

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

Inherited from

EntityMp.type


weapon

weapon: number

The hash of the ped's weapon in hand, as the server keeps it.

Remarks

Partial: the weapon is kept on the server (as the ped's sixl:weapon data) and read and written there; the client does not follow the weapon the ped holds. A GTA V weapon name does not work in VI: use a hash.

Example

ped.weapon = 0xA2719263;

Methods

applyBloodDamageByZone()

applyBloodDamageByZone(p1, p2, p3, p4): void

Adds blood damage to a body zone of the ped.

Parameters

p1

number

The first float the game takes, passed on as it is (RAGE MP's p1).

p2

number

The second float, passed on as it is (RAGE MP's p2).

p3

number

The third float, passed on as it is (RAGE MP's p3).

p4

number

The fourth float, passed on as it is (RAGE MP's p4).

Returns

void

Remarks

Partial: the four values go to the game unchanged, and their meaning is the game's (SixL does not name them).

Example

ped.applyBloodDamageByZone(0.5, 0.5, 0.2, 0.1);

applyDamagePack()

applyDamagePack(damagePack, damage, mult): void

Applies a named damage pack to the ped: a damage preset with a value and a multiplier.

Parameters

damagePack

string

The damage pack's name, hashed as a name, or its hash.

damage

number

The damage value (health points).

mult

number

The multiplier applied to the damage (a factor, 1 is no change).

Returns

void

Example

ped.applyDamagePack('damage-pack-name', 50, 1);

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

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

Inherited from

EntityMp.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

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

Inherited from

EntityMp.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

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

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

Inherited from

EntityMp.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

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

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

Inherited from

EntityMp.attachToPhysically


canInCombatSeeTarget()

canInCombatSeeTarget(target): Promise<boolean>

Whether the ped, in combat, can see the target.

Parameters

target

number | EntityMp

The target entity.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const sees = await ped.canInCombatSeeTarget(enemy);

clearBloodDamage()

clearBloodDamage(): void

Clears all blood from the ped.

Returns

void

Example

ped.clearBloodDamage();

clearBloodDamageByZone()

clearBloodDamageByZone(p1): void

Clears the blood of one body zone.

Parameters

p1

number

The zone's index (the game's, RAGE MP's p1).

Returns

void

Example

ped.clearBloodDamageByZone(0);

clearFacialIdleAnimOverride()

clearFacialIdleAnimOverride(): void

Clears the facial idle animation set on the ped, back to the default.

Returns

void

Example

ped.clearFacialIdleAnimOverride();

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

vehicle.clearLastDamage();

Inherited from

EntityMp.clearLastDamage


clearTasks()

clearTasks(): void

Makes the ped drop its tasks.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.clearTasks();

clearTasksImmediately()

clearTasksImmediately(): void

Clears all the tasks of the ped at once.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.clearTasksImmediately();

clearWetness()

clearWetness(): void

Clears the wetness of the ped (drying it).

Returns

void

Example

ped.clearWetness();

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

ped.destroy();

Inherited from

EntityMp.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

entity.detach(true, true);

Inherited from

EntityMp.detach


dist()

dist(position): number

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

Parameters

position

Vector3

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

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

Inherited from

EntityMp.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

The point (metres).

Returns

number

The squared 3D distance in square metres.

Remarks

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

Example

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

Inherited from

EntityMp.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

const ours = await entity.doesBelongToThisScript();

Inherited from

EntityMp.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

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

Inherited from

EntityMp.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

const visible = await entity.doesHaveDrawable();

Inherited from

EntityMp.doesHaveDrawable


doesHavePhysics()

doesHavePhysics(): Promise<boolean>

Whether the entity has physics (is simulated).

Returns

Promise<boolean>

A Promise of true or false.

Example

const simulated = await entity.doesHavePhysics();

Inherited from

EntityMp.doesHavePhysics


forceAiAndAnimationUpdate()

forceAiAndAnimationUpdate(): void

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

Returns

void

Example

entity.forceAiAndAnimationUpdate();

Inherited from

EntityMp.forceAiAndAnimationUpdate


forceMotionState()

forceMotionState(motionStateHash, p2, p3, p4): Promise<boolean>

Sets the ped's motion state (its movement mode).

Parameters

motionStateHash

string | number

The motion state's hash, or its name (hashed).

p2

boolean

The game's flag (RAGE MP's p2), passed on as it is.

p3

number | boolean

The game's integer (RAGE MP's p3), passed on as it is; true counts as 1 and false as 0.

p4

boolean

The game's flag (RAGE MP's p4), passed on as it is.

Returns

Promise<boolean>

A promise of whether the game accepted the state; asynchronous, from the game.

Example

const ok = await ped.forceMotionState('motion-state-name', false, 0, false);

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

vehicle.forceStreamingUpdate();

Inherited from

EntityMp.forceStreamingUpdate


forceToOpenParachute()

forceToOpenParachute(): void

Makes the ped open its parachute now.

Returns

void

Example

ped.forceToOpenParachute();

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

player.freezePosition(true);

Inherited from

EntityMp.freezePosition


getAccuracy()

getAccuracy(): Promise<number>

Returns the ped's accuracy.

Returns

Promise<number>

A promise of the accuracy; asynchronous, from the game.

Example

const acc = await ped.getAccuracy();

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

const alpha = await player.getAlpha();

Inherited from

EntityMp.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

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

Inherited from

EntityMp.getAnimCurrentTime


getArmour()

getArmour(): number

Returns the armour value of the ped.

Returns

number

The armour, from the frame's state; synchronous.

Remarks

Partial: the local player's armour is the value the server last sent it. The client is not told another player's armour and a server ped has none, so both answer 0. There is no way to set armour from the client.

Example

const armour = mp.players.local.getArmour();

getAttachedTo()

getAttachedTo(): Promise<EntityMp>

The entity this one is attached to.

Returns

Promise<EntityMp>

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

const carrier = await prop.getAttachedTo();

Inherited from

EntityMp.getAttachedTo


getBoneCoords()

getBoneCoords(boneId, offsetX, offsetY, offsetZ): Promise<Vector3>

Returns the position of a bone of the ped.

Parameters

boneId

number

The bone's index.

offsetX

number

The offset from the bone along x, in metres.

offsetY

number

The offset from the bone along y, in metres.

offsetZ

number

The offset from the bone along z, in metres.

Returns

Promise<Vector3>

A promise of the position in metres; asynchronous, from the game.

Example

const hand = await ped.getBoneCoords(bone, 0, 0, 0);

getBoneIndex()

getBoneIndex(boneId): Promise<number>

Returns the index of a bone of the ped by its id.

Parameters

boneId

number

The bone's id (the game's).

Returns

Promise<number>

A promise of the bone's index; asynchronous, from the game.

Example

const index = await ped.getBoneIndex(boneId);

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

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

Inherited from

EntityMp.getBoneIndexByName


getCauseOfDeath()

getCauseOfDeath(): Promise<number>

Returns the cause of the ped's death, as a hash.

Returns

Promise<number>

A promise of the hash (an unsigned number); asynchronous, from the game.

Example

const cause = await ped.getCauseOfDeath();

getCombatFloat()

getCombatFloat(p1): Promise<number>

Returns a combat attribute's float value.

Parameters

p1

number

The combat type index (RAGE MP's p1; the first argument of the game call is the ped itself).

Returns

Promise<number>

A promise of the value; asynchronous, from the game.

Remarks

RAGE MP's first parameter, the ped, is not taken: the call is made on the ped itself.

Example

const range = await ped.getCombatFloat(0);

getCombatMovement()

getCombatMovement(): Promise<number>

Returns the ped's combat movement mode.

Returns

Promise<number>

A promise of the mode (the game's index); asynchronous, from the game.

Example

const mode = await ped.getCombatMovement();

getCombatRange()

getCombatRange(): Promise<number>

Returns the ped's combat range (how far it fights).

Returns

Promise<number>

A promise of the range (the game's index); asynchronous, from the game.

Example

const range = await ped.getCombatRange();

getConfigFlag()

getConfigFlag(flagId, p2?): Promise<boolean>

Returns one of the ped's configuration flags.

Parameters

flagId

number

The flag's id (the game's).

p2?

boolean

Accepted for RAGE MP compatibility; ignored.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Remarks

RAGE MP's second parameter is not taken.

Example

const flag = await ped.getConfigFlag(32);

getCoords()

getCoords(alive): Promise<IVector3>

The entity's position from the game.

Parameters

alive

boolean

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

Returns

Promise<IVector3>

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

Remarks

Asynchronous. Unlike EntityMp.position, this asks the game and is not the client's copy.

Example

const pos = await entity.getCoords(true);

Inherited from

EntityMp.getCoords


getDefensiveAreaPosition()

getDefensiveAreaPosition(p1): Promise<Vector3>

Returns the centre of the ped's defensive area (the area it guards).

Parameters

p1

boolean

The game's flag (RAGE MP's p1), passed on as it is.

Returns

Promise<Vector3>

A promise of the position in metres; asynchronous, from the game.

Example

const centre = await ped.getDefensiveAreaPosition(false);

getDesiredMoveBlendRatio()

getDesiredMoveBlendRatio(): Promise<number>

The move blend ratio the ped aims for.

Returns

Promise<number>

A Promise of the move blend ratio as a float.

Remarks

Partial: read from this client's game.

Example

const ratio = await ped.getDesiredMoveBlendRatio();

getForwardVector()

getForwardVector(): Promise<IVector3>

The direction the entity faces.

Returns

Promise<IVector3>

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

Example

const forward = await entity.getForwardVector();

Inherited from

EntityMp.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.

Example

const x = await vehicle.getForwardX();

Inherited from

EntityMp.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.

Example

const y = await vehicle.getForwardY();

Inherited from

EntityMp.getForwardY


getGroupIndex()

getGroupIndex(): Promise<number>

The group the ped is in.

Returns

Promise<number>

A Promise of the group, 0 when the ped is in none.

Remarks

Partial: read from this client's game. A group is a number this client got from createGroup or getGroupIndex (0 is no group); a number it never got is refused.

Example

const group = await ped.getGroupIndex();

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

const heading = player.getHeading();

Inherited from

EntityMp.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.

Example

const health = await ped.getHealth();

Inherited from

EntityMp.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

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

Inherited from

EntityMp.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

const above = await vehicle.getHeightAboveGround();

Inherited from

EntityMp.getHeightAboveGround


getIsTaskActive()

getIsTaskActive(taskIndex): Promise<boolean>

Whether a task is active on the ped.

Parameters

taskIndex

number

The task's index, as an integer.

Returns

Promise<boolean>

A Promise of true while the task runs.

Remarks

Partial: read from this client's game.

Example

const active = await ped.getIsTaskActive(0);

getJackTarget()

getJackTarget(): Promise<number>

The ped this ped is pulling out of a vehicle.

Returns

Promise<number>

A promise of its handle, 0 when there is none the client knows.

Remarks

Partial: the game's answer as the script handle of a player, ped, vehicle or object this client has; 0 when it is none of those (a ped of the game's own, the world). Not yet confirmed in the game.

Example

const target = await ped.getJackTarget();

getLastDamageBone()

getLastDamageBone(outBone): Promise<number>

The bone the ped was last damaged at.

Parameters

outBone

number

Not used: the bone is the answer.

Returns

Promise<number>

A promise of the bone, 0 when none is known.

Remarks

Partial: not yet confirmed in the game.

Example

const bone = await ped.getLastDamageBone(0);

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

const lod = await entity.getLodDist();

Inherited from

EntityMp.getLodDist


getMatrix()

getMatrix(): Promise<{ forwardVector: IVector3; position: IVector3; rightVector: IVector3; upVector: IVector3; }>

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

Returns

Promise<{ forwardVector: IVector3; position: IVector3; rightVector: IVector3; upVector: IVector3; }>

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

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

Inherited from

EntityMp.getMatrix


getMaxHealth()

getMaxHealth(): Promise<number>

Returns the ped's maximum health.

Returns

Promise<number>

A promise of the maximum health (points); asynchronous, from the game.

Example

const max = await ped.getMaxHealth();

Overrides

EntityMp.getMaxHealth


getMeleeTargetFor()

getMeleeTargetFor(): Promise<number>

The ped this ped fights hand to hand.

Returns

Promise<number>

A promise of its handle, 0 when there is none the client knows.

Remarks

Partial: the game's answer as the script handle of a player, ped, vehicle or object this client has; 0 when it is none of those (a ped of the game's own, the world). Not yet confirmed in the game.

Example

const target = await ped.getMeleeTargetFor();

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

const hash = await entity.getModel();

Inherited from

EntityMp.getModel


getMoney()

getMoney(): Promise<number>

Returns the money the ped carries.

Returns

Promise<number>

A promise of the amount; asynchronous, from the game.

Example

const cash = await ped.getMoney();

getNavmeshRouteDistanceRemaining()

getNavmeshRouteDistanceRemaining(p1?, p2?): Promise<{ distanceRemaining: number; isPathReady: boolean; result: number; }>

The distance the ped still has to walk along its navigation-mesh route.

Parameters

p1?

unknown

Not used by SixL: accepted for compatibility.

p2?

unknown

Not used by SixL: accepted for compatibility.

Returns

Promise<{ distanceRemaining: number; isPathReady: boolean; result: number; }>

A Promise of { result, distanceRemaining, isPathReady }: result the game's integer answer, distanceRemaining the distance in metres, isPathReady true once the route is computed.

Remarks

Partial: read from this client's game.

Example

const { distanceRemaining, isPathReady } = await ped.getNavmeshRouteDistanceRemaining();

getNearbyPeds()

getNearbyPeds(sizeAndPeds?, ignore?): Promise<number[]>

The peds near this ped.

Parameters

sizeAndPeds?

number

Not used (GTA V's array).

ignore?

number

A ped type to leave out, VI's value as the game takes it.

Returns

Promise<number[]>

A Promise of the handles of the peds this client has near it (players and the server's peds; the game's own are left out), in the game's order.

Remarks

Partial: RAGE MP answers the count; here the handles. 19 at most, the rest left out without a word. Not yet confirmed in the game.

Example

const near = await ped.getNearbyPeds(0, -1);

getNearbyVehicles()

getNearbyVehicles(sizeAndVehs?): Promise<number[]>

The vehicles near this ped.

Parameters

sizeAndVehs?

number

Not used (GTA V's array).

Returns

Promise<number[]>

A Promise of the handles of the vehicles this client has near it (the server's; the game's own are left out), in the game's order.

Remarks

Partial: RAGE MP answers the count; here the handles. 19 at most, the rest left out without a word. Not yet confirmed in the game.

Example

const cars = await mp.players.local.getNearbyVehicles();

getNearestPlayerTo()

getNearestPlayerTo(): PlayerMp

The player closest to the entity.

Returns

PlayerMp

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

const other = player.getNearestPlayerTo();

Inherited from

EntityMp.getNearestPlayerTo


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

const index = entity.getObjectIndexFromIndex();

Inherited from

EntityMp.getObjectIndexFromIndex


getOffsetFromGivenWorldCoords()

getOffsetFromGivenWorldCoords(posX, posY, posZ): Promise<IVector3>

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>

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.

Example

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

Inherited from

EntityMp.getOffsetFromGivenWorldCoords


getOffsetFromInWorldCoords()

getOffsetFromInWorldCoords(offsetX, offsetY, offsetZ): Promise<IVector3>

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>

A Promise of the world position in metres.

Remarks

Composed from the entity's quaternion and coordinates.

Example

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

Inherited from

EntityMp.getOffsetFromInWorldCoords


getParachuteState()

getParachuteState(): Promise<number>

Returns the ped's parachute state (closed, opening, open ...).

Returns

Promise<number>

A promise of the state (the game's index); asynchronous, from the game.

Example

const state = await ped.getParachuteState();

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

const index = entity.getPedIndexFromIndex();

Inherited from

EntityMp.getPedIndexFromIndex


getPhysicsHeading()

getPhysicsHeading(): Promise<number>

The heading the entity's physics has.

Returns

Promise<number>

The heading in degrees, 0 to 360, as EntityMp.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

const heading = await vehicle.getPhysicsHeading();

Inherited from

EntityMp.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.

Example

const pitch = await vehicle.getPitch();

Inherited from

EntityMp.getPitch


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

const kind = await ped.getPopulationType();

Inherited from

EntityMp.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

const q = await entity.getQuaternion();

Inherited from

EntityMp.getQuaternion


getRelationshipBetweens()

getRelationshipBetweens(ped2): Promise<number>

The relationship between this ped and another one.

Parameters

ped2

number | { handle: number; }

The other ped, or its handle.

Returns

Promise<number>

A promise of the relationship, as the game numbers it.

Remarks

Partial: not yet confirmed in the game. Returns the relationship, where RAGE MP's typings say nothing is returned.

Example

const rel = await ped.getRelationshipBetweens(other);

getRelationshipGroupDefaultHash()

getRelationshipGroupDefaultHash(): Promise<number>

Returns the default relationship group hash of the ped.

Returns

Promise<number>

A promise of the hash (an unsigned number); asynchronous, from the game.

Example

const group = await ped.getRelationshipGroupDefaultHash();

getRelationshipGroupHash()

getRelationshipGroupHash(): Promise<number>

Returns the relationship group hash of the ped.

Returns

Promise<number>

A promise of the hash (an unsigned number); asynchronous, from the game.

Example

const group = await ped.getRelationshipGroupHash();

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.

Example

const roll = await vehicle.getRoll();

Inherited from

EntityMp.getRoll


getRotation()

getRotation(order?): Promise<IVector3>

The entity's rotation, in degrees.

Parameters

order?

number

The rotation order the game uses; 2 when omitted.

Returns

Promise<IVector3>

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

Example

const rot = await entity.getRotation();

Inherited from

EntityMp.getRotation


getRotationVelocity()

getRotationVelocity(): Promise<IVector3>

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

Returns

Promise<IVector3>

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

Example

const spin = await entity.getRotationVelocity();

Inherited from

EntityMp.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

const owner = await entity.getScript();

Inherited from

EntityMp.getScript


getScriptTaskStatus()

getScriptTaskStatus(taskHash): Promise<number>

The status of a script task of the ped.

Parameters

taskHash

string | number

The task's hash, or its name.

Returns

Promise<number>

A Promise of the status as an integer, the game's own values.

Remarks

Partial: read from this client's game.

Example

const status = await ped.getScriptTaskStatus(mp.joaat('<task name>'));

getSeatIsTryingToEnter()

getSeatIsTryingToEnter(): Promise<number>

The seat the ped is trying to get into.

Returns

Promise<number>

A promise of the seat, as the game numbers it.

Remarks

Partial: not yet confirmed in the game.

Example

const seat = await ped.getSeatIsTryingToEnter();

getSequenceProgress()

getSequenceProgress(): Promise<number>

The progress of the ped's task sequence.

Returns

Promise<number>

A Promise of the progress as an integer.

Remarks

Partial: read from this client's game.

Example

const progress = await ped.getSequenceProgress();

getsJacker()

getsJacker(): Promise<number>

The ped pulling this ped out of its vehicle.

Returns

Promise<number>

A promise of its handle, 0 when there is none the client knows.

Remarks

Partial: the game's answer as the script handle of a player, ped, vehicle or object this client has; 0 when it is none of those (a ped of the game's own, the world). Not yet confirmed in the game.

Example

const jacker = await ped.getsJacker();

getSourceOfDeath()

getSourceOfDeath(): Promise<number>

What killed the ped.

Returns

Promise<number>

A promise of its handle, 0 when there is none the client knows.

Remarks

Partial: the game's answer as the script handle of a player, ped, vehicle or object this client has; 0 when it is none of those (a ped of the game's own, the world). Not yet confirmed in the game.

Example

const killer = await ped.getSourceOfDeath();

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

const speed = await vehicle.getSpeed();

Inherited from

EntityMp.getSpeed


getSpeedVector()

getSpeedVector(relative): Promise<IVector3>

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>

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

Example

const v = await entity.getSpeedVector(false);

Inherited from

EntityMp.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

const sunk = await entity.getSubmergedLevel();

Inherited from

EntityMp.getSubmergedLevel


getTimeOfDeath()

getTimeOfDeath(): Promise<number>

Returns the time the ped died.

Returns

Promise<number>

A promise of the time (the game's unit); asynchronous, from the game.

Example

const when = await ped.getTimeOfDeath();

getType()

getType(): Promise<number>

Returns the entity's type, as the game's index.

Returns

Promise<number>

A promise of the type; asynchronous, from the game.

Example

const type = await ped.getType();

Overrides

EntityMp.getType


getUprightValue()

getUprightValue(): Promise<number>

How upright the entity is.

Returns

Promise<number>

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

Example

const upright = await vehicle.getUprightValue();

Inherited from

EntityMp.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

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

Inherited from

EntityMp.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

const index = entity.getVehicleIndexFromIndex();

Inherited from

EntityMp.getVehicleIndexFromIndex


getVehicleIsIn()

getVehicleIsIn(getLastVehicle): number

The vehicle the ped sits in.

Parameters

getLastVehicle

boolean

On foot, answer the last vehicle instead of 0.

Returns

number

The vehicle's handle, 0 when on foot.

Remarks

Partial: answered from the seat the core reports, not from the game: the local player's vehicle, another player's vehicle when it is streamed in (else 0). A server ped's seat is not known to the client: it throws. Not yet confirmed in the game. With getLastVehicle, on foot it answers the last vehicle this call saw.

Example

const vehicle = mp.players.local.getVehicleIsIn(false);

getVehicleIsTryingToEnter()

getVehicleIsTryingToEnter(): Promise<number>

The vehicle the ped is getting into.

Returns

Promise<number>

A promise of its handle, 0 when there is none the client knows.

Remarks

Partial: the game's answer as the script handle of a player, ped, vehicle or object this client has; 0 when it is none of those (a ped of the game's own, the world). Not yet confirmed in the game.

Example

const vehicle = await ped.getVehicleIsTryingToEnter();

getVehicleIsUsing()

getVehicleIsUsing(): number

The vehicle the ped is using: the one it sits in.

Returns

number

The vehicle's handle, 0 when on foot.

Remarks

Partial: answered from the seat the core reports, not from the game: the local player's vehicle, another player's vehicle when it is streamed in (else 0). A server ped's seat is not known to the client: it throws. Not yet confirmed in the game.

Example

const vehicle = mp.players.local.getVehicleIsUsing();

getVelocity()

getVelocity(): Vector3 | Promise<Vector3>

The entity's velocity as a vector.

Returns

Vector3 | Promise<Vector3>

The velocity in metres per second, as a Vector3, 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

const v = await vehicle.getVelocity();

Inherited from

EntityMp.getVelocity


giveWeapon()

giveWeapon(weapon, ammo, equipNow): void

Gives a weapon to a ped. This is the server's call: on the server it sets the ped's weapon.

Parameters

weapon

string | number

The weapon's hash, or its name (hashed). GTA V names do not work in VI: use the hash.

ammo

number

The ammunition, a count. A value that is not a number is replaced by 100 on the client.

equipNow

boolean

RAGE MP's flag to equip the weapon at once; the client accepts it and does not use it.

Returns

void

Remarks

Partial: the client has no such method on a streamed ped. The server stores the weapon as the ped's sixl:weapon data, which reaches the game through the core; ammunition is not sent with it. The local player gets a weapon from the server's giveWeapon event, which the client gives it with the ammunition above.

Example

player.giveWeapon(0xA2719263, 100, true);

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

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

Inherited from

EntityMp.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

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

Inherited from

EntityMp.hasAnimFinished


hasBeenDamagedBy()

hasBeenDamagedBy(entity, p1): Promise<boolean>

Whether a given entity has damaged this one: the same question as EntityMp.hasBeenDamagedByEntity.

Parameters

entity

number | EntityMp

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

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

Inherited from

EntityMp.hasBeenDamagedBy


hasBeenDamagedByAnyObject()

hasBeenDamagedByAnyObject(): Promise<boolean>

Whether any object has damaged the entity.

Returns

Promise<boolean>

A Promise of true or false.

Example

const hit = await vehicle.hasBeenDamagedByAnyObject();

Inherited from

EntityMp.hasBeenDamagedByAnyObject


hasBeenDamagedByAnyPed()

hasBeenDamagedByAnyPed(): Promise<boolean>

Whether any ped has damaged the entity.

Returns

Promise<boolean>

A Promise of true or false.

Example

const hit = await vehicle.hasBeenDamagedByAnyPed();

Inherited from

EntityMp.hasBeenDamagedByAnyPed


hasBeenDamagedByAnyVehicle()

hasBeenDamagedByAnyVehicle(): Promise<boolean>

Whether any vehicle has damaged the entity.

Returns

Promise<boolean>

A Promise of true or false.

Example

const hit = await ped.hasBeenDamagedByAnyVehicle();

Inherited from

EntityMp.hasBeenDamagedByAnyVehicle


hasBeenDamagedByEntity()

hasBeenDamagedByEntity(entity, p2): Promise<boolean>

Whether a given entity has damaged this one.

Parameters

entity

number | EntityMp

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

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

Inherited from

EntityMp.hasBeenDamagedByEntity


hasClearLosTo()

hasClearLosTo(entity, traceType): Promise<boolean>

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

Parameters

entity

number | EntityMp

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

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

Inherited from

EntityMp.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

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

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

Inherited from

EntityMp.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

const crashed = await vehicle.hasCollidedWithAnything();

Inherited from

EntityMp.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

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

Inherited from

EntityMp.hasVariable


haveAllStreamingRequestsCompleted()

haveAllStreamingRequestsCompleted(): Promise<boolean>

Whether all the streaming requests of the ped are done.

Returns

Promise<boolean>

A promise of true when they are.

Remarks

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

Example

if (await ped.haveAllStreamingRequestsCompleted()) { }

isActiveInScenario()

isActiveInScenario(): Promise<boolean>

Whether the ped is active in a scenario.

Returns

Promise<boolean>

A Promise of true while the ped is in a scenario.

Remarks

Partial: read from this client's game.

Example

const active = await ped.isActiveInScenario();

isAimingFromCover()

isAimingFromCover(): Promise<boolean>

Whether the ped is aiming from cover.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const aiming = await ped.isAimingFromCover();

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

const kept = await entity.isAMission();

Inherited from

EntityMp.isAMission


isAnObject()

isAnObject(): Promise<boolean>

Whether the entity is an object.

Returns

Promise<boolean>

A Promise of true or false.

Example

const prop = await entity.isAnObject();

Inherited from

EntityMp.isAnObject


isAPed()

isAPed(): Promise<boolean>

Whether the entity is a ped.

Returns

Promise<boolean>

A Promise of true or false.

Example

const ped = await entity.isAPed();

Inherited from

EntityMp.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

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

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

Inherited from

EntityMp.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

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

Inherited from

EntityMp.isAtCoord


isAttached()

isAttached(): Promise<boolean>

Whether the entity is attached to something.

Returns

Promise<boolean>

A Promise of true or false.

Example

const attached = await entity.isAttached();

Inherited from

EntityMp.isAttached


isAttachedTo()

isAttachedTo(entity): Promise<boolean>

Whether this entity is attached to the given one.

Parameters

entity

number | EntityMp

The possible carrier: an entity object or its handle.

Returns

Promise<boolean>

A Promise of true or false.

Example

const onTruck = await prop.isAttachedTo(truck);

Inherited from

EntityMp.isAttachedTo


isAttachedToAnyObject()

isAttachedToAnyObject(): Promise<boolean>

Whether the entity is attached to an object.

Returns

Promise<boolean>

A Promise of true or false.

Example

const onProp = await entity.isAttachedToAnyObject();

Inherited from

EntityMp.isAttachedToAnyObject


isAttachedToAnyPed()

isAttachedToAnyPed(): Promise<boolean>

Whether the entity is attached to a ped.

Returns

Promise<boolean>

A Promise of true or false.

Example

const onPed = await entity.isAttachedToAnyPed();

Inherited from

EntityMp.isAttachedToAnyPed


isAttachedToAnyVehicle()

isAttachedToAnyVehicle(): Promise<boolean>

Whether the entity is attached to a vehicle.

Returns

Promise<boolean>

A Promise of true or false.

Example

const onCar = await entity.isAttachedToAnyVehicle();

Inherited from

EntityMp.isAttachedToAnyVehicle


isAVehicle()

isAVehicle(): Promise<boolean>

Whether the entity is a vehicle.

Returns

Promise<boolean>

A Promise of true or false.

Example

const car = await entity.isAVehicle();

Inherited from

EntityMp.isAVehicle


isBeingArrested()

isBeingArrested(atArresting): Promise<boolean>

Whether the ped is being arrested.

Parameters

atArresting

boolean

Passed to the game as it is.

Returns

Promise<boolean>

A promise of true while it is.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isBeingArrested(false)) { }

isBeingJacked()

isBeingJacked(): Promise<boolean>

Whether the ped is being jacked (someone is pulling it out of a vehicle).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const pulled = await ped.isBeingJacked();

isBeingStealthKilled()

isBeingStealthKilled(): Promise<boolean>

Whether the ped is being stealth-killed.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const sneaked = await ped.isBeingStealthKilled();

isBeingStunned()

isBeingStunned(p1): Promise<boolean>

Whether the ped is stunned.

Parameters

p1

number

The game's stun index, passed on as it is (RAGE MP's p1).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const stunned = await ped.isBeingStunned(0);

isCollisonDisabled()

isCollisonDisabled(): Promise<boolean>

Whether the entity's collision is turned off.

Returns

Promise<boolean>

A Promise of true or false.

Example

const off = await ped.isCollisonDisabled();

Remarks

The name keeps RAGE MP's spelling.

Inherited from

EntityMp.isCollisonDisabled


isCuffed()

isCuffed(): Promise<boolean>

Whether the ped is cuffed.

Returns

Promise<boolean>

A promise of true when it is.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isCuffed()) { }

isDead()

isDead(): boolean | Promise<boolean>

Whether the ped is dead.

Returns

boolean | Promise<boolean>

A boolean for the local player (the flag from the frame's state), a Promise of it for the other kinds.

Remarks

Same as EntityMp.isDead: synchronous on the local player, the game is asked for the rest.

Example

const dead = mp.players.local.isDead();

Overrides

EntityMp.isDead


isDeadOrDying()

isDeadOrDying(p1?): boolean | Promise<boolean>

Whether the ped is dead or dying.

Parameters

p1?

boolean

Not used on the local player (RAGE MP's p1); kept for the same call shape.

Returns

boolean | Promise<boolean>

A boolean for the local player (the death flag of the client's own copy), a Promise of the game's answer for a remote player and a server ped.

Remarks

Synchronous on the local player, where it is the same as isDead(); the game is asked for every other ped kind, so await works on both. Partial until a recording of the game's answers exists.

Example

const gone = await ped.isDeadOrDying(false);

isDiving()

isDiving(): Promise<boolean>

Whether the ped is diving.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const diving = await ped.isDiving();

isDoingDriveby()

isDoingDriveby(): Promise<boolean>

Whether the ped is doing a drive-by shooting from a vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const driveBy = await ped.isDoingDriveby();

isDucking()

isDucking(): Promise<boolean>

Whether the ped is ducking.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const crouched = await ped.isDucking();

isEvasiveDiving()

isEvasiveDiving(evadingEntity): Promise<boolean>

Whether the ped is diving out of the way of something.

Parameters

evadingEntity

number

Not used: the entity evaded is not handed out.

Returns

Promise<boolean>

A promise of true while it is.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isEvasiveDiving(0)) { }

isFacingPed()

isFacingPed(otherPed, angle): Promise<boolean>

Whether the ped is facing another ped, within an angle.

Parameters

otherPed

number | EntityMp

The other ped.

angle

number

The angle the game checks, passed on as it is (the game's unit).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const facing = await ped.isFacingPed(other, 30);

isFalling()

isFalling(): Promise<boolean>

Whether the ped is falling.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const falling = await ped.isFalling();

isFatallyInjured()

isFatallyInjured(): Promise<boolean>

Whether the ped is fatally injured.

Returns

Promise<boolean>

A promise of the flag. The answer comes from the game, so it is asynchronous.

Remarks

Works on the local player, a remote player and a server ped.

Example

const dying = await ped.isFatallyInjured();

isFleeing()

isFleeing(): Promise<boolean>

Whether the ped is fleeing.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const running = await ped.isFleeing();

isGettingIntoAVehicle()

isGettingIntoAVehicle(): Promise<boolean>

Whether the ped is getting into a vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const entering = await ped.isGettingIntoAVehicle();

isGettingUp()

isGettingUp(): Promise<boolean>

Whether the ped is getting up.

Returns

Promise<boolean>

A promise of true while it is.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isGettingUp()) { }

isGoingIntoCover()

isGoingIntoCover(): Promise<boolean>

Whether the ped is going into cover.

Returns

Promise<boolean>

A promise of the flag (the game's integer answer read as a flag); asynchronous, from the game.

Example

const cover = await ped.isGoingIntoCover();

isGroupMember()

isGroupMember(groupId): Promise<boolean>

Whether the ped is a member of a group.

Parameters

groupId

number

The group, as createGroup or getGroupIndex gave it.

Returns

Promise<boolean>

A Promise of true when the ped is a member.

Remarks

Partial: read from this client's game. A group is a number this client got from createGroup or getGroupIndex (0 is no group); a number it never got is refused.

Example

const member = await ped.isGroupMember(group);

isHuman()

isHuman(): Promise<boolean>

Whether the ped is human (not an animal).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const human = await ped.isHuman();

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

const flying = await player.isInAir();

Inherited from

EntityMp.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

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

Inherited from

EntityMp.isInAngledArea


isInAnyVehicle()

isInAnyVehicle(atGetIn): boolean

Whether the ped is in any vehicle.

Parameters

atGetIn

boolean

Whether to count a ped that is only getting in, as the game's flag.

Returns

boolean

The flag from the frame's state; synchronous.

Remarks

Partial: on the local player only. A streamed ped does not have it yet (the game answers isInVehicle for a ped instead).

Example

const inCar = mp.players.local.isInAnyVehicle(false);

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

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

Inherited from

EntityMp.isInArea


isInCombat()

isInCombat(target): Promise<boolean>

Whether the ped is in combat with the given target.

Parameters

target

number | EntityMp

The target entity.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const fighting = await ped.isInCombat(enemy);

isInGroup()

isInGroup(): Promise<boolean>

Whether the ped is in a group.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const grouped = await ped.isInGroup();

isInjured()

isInjured(): Promise<boolean>

Whether the ped is injured.

Returns

Promise<boolean>

A promise of the flag. The answer comes from the game, so it is asynchronous.

Remarks

Works on the local player, a remote player and a server ped. Partial: the game's threshold for "injured" has not been compared with PedMpBase.isFatallyInjured yet.

Example

const hurt = await ped.isInjured();

isInMeleeCombat()

isInMeleeCombat(): Promise<boolean>

Whether the ped is in melee combat.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const brawl = await ped.isInMeleeCombat();

isInParachuteFreeFall()

isInParachuteFreeFall(): Promise<boolean>

Whether the ped is in a parachute's free fall.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const freefall = await ped.isInParachuteFreeFall();

isInVehicle()

isInVehicle(vehicle, atGetIn): Promise<boolean>

Whether the ped is in a vehicle.

Parameters

vehicle

number | EntityMp

The vehicle.

atGetIn

boolean

Whether to count a ped that is only getting in, as the game's flag (RAGE MP's atGetIn).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const riding = await ped.isInVehicle(car, false);

isInWater()

isInWater(): Promise<boolean>

Whether the entity is in water.

Returns

Promise<boolean>

A Promise of true or false.

Example

const swimming = await player.isInWater();

Inherited from

EntityMp.isInWater


isInWrithe()

isInWrithe(): Promise<boolean>

Whether the ped is writhing on the ground.

Returns

Promise<boolean>

A promise of true while it is.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isInWrithe()) { }

isJacking()

isJacking(): Promise<boolean>

Whether the ped is jacking (pulling someone out of) a vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const jacking = await ped.isJacking();

isJumpingOutOfVehicle()

isJumpingOutOfVehicle(): Promise<boolean>

Whether the ped is jumping out of a vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const bailing = await ped.isJumpingOutOfVehicle();

isMale()

isMale(): Promise<boolean>

Whether the ped is male.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const male = await ped.isMale();

isModel()

isModel(modelHash): Promise<boolean>

Whether the ped is of the given model.

Parameters

modelHash

string | number

The model's hash: a number (a 64-bit key as in VI) or a name, which is hashed.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Remarks

GTA V model names do not resolve in VI: give the model's key (0x...).

Example

const isProp = await ped.isModel('<model name>');

isMoveBlendRatioRunning()

isMoveBlendRatioRunning(): Promise<boolean>

Whether the ped's desired move blend ratio is a run.

Returns

Promise<boolean>

A promise of true when it is.

Remarks

Partial: not yet confirmed in the game. Asks the ped's desired ratio, then whether that ratio is a run.

Example

if (await ped.isMoveBlendRatioRunning()) { }

isMoveBlendRatioSprinting()

isMoveBlendRatioSprinting(): Promise<boolean>

Whether the ped's desired move blend ratio is a sprint.

Returns

Promise<boolean>

A promise of true when it is.

Remarks

Partial: not yet confirmed in the game. Asks the ped's desired ratio, then whether that ratio is a sprint.

Example

if (await ped.isMoveBlendRatioSprinting()) { }

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

const hidden = await ped.isOccluded();

Inherited from

EntityMp.isOccluded


isOnAnyBike()

isOnAnyBike(): Promise<boolean>

Whether the ped is on a bicycle or a motorbike.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const riding = await ped.isOnAnyBike();

isOnFoot()

isOnFoot(): Promise<boolean>

Whether the ped is on foot (not in a vehicle and not on a bike).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const walking = await ped.isOnFoot();

isOnScreen()

isOnScreen(): Promise<boolean>

Whether the entity is on the screen.

Returns

Promise<boolean>

A Promise of true or false.

Example

const onScreen = await ped.isOnScreen();

Inherited from

EntityMp.isOnScreen


isOnSpecificVehicle()

isOnSpecificVehicle(vehicle): Promise<boolean>

Whether the ped stands on a given vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

Returns

Promise<boolean>

A promise of true when it does.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isOnSpecificVehicle(vehicle)) { }

isOnVehicle()

isOnVehicle(): Promise<boolean>

Whether the ped stands on a vehicle.

Returns

Promise<boolean>

A promise of true when it does.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isOnVehicle()) { }

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

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

Inherited from

EntityMp.isPlayingAnim


isRagdoll()

isRagdoll(): Promise<boolean>

Whether the ped is in ragdoll (limp, physics-driven) state.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const limp = await ped.isRagdoll();

isReloading()

isReloading(): boolean

Whether the ped is reloading its weapon.

Returns

boolean

The flag from the frame's state; synchronous.

Remarks

Partial: on the local player only. A streamed ped does not have it yet.

Example

const busy = mp.players.local.isReloading();

isRunning()

isRunning(): Promise<boolean>

Whether the ped runs.

Returns

Promise<boolean>

A Promise of true while the ped runs.

Remarks

Partial: read from this client's game.

Example

const running = await ped.isRunning();

isRunningMobilePhoneTask()

isRunningMobilePhoneTask(): Promise<boolean>

Whether the ped is running a mobile-phone task.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const phoning = await ped.isRunningMobilePhoneTask();

isShooting()

isShooting(): boolean

Whether the ped is shooting.

Returns

boolean

The flag from the frame's state; synchronous.

Remarks

Partial: on the local player only. A streamed ped does not have it yet.

Example

const firing = mp.players.local.isShooting();

isSittingInAnyVehicle()

isSittingInAnyVehicle(): Promise<boolean>

Whether the ped is sitting in any vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const seated = await ped.isSittingInAnyVehicle();

isSittingInVehicle()

isSittingInVehicle(vehicle): Promise<boolean>

Whether the ped is sitting in the given vehicle.

Parameters

vehicle

number | EntityMp

The vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const inThis = await ped.isSittingInVehicle(car);

isSprinting()

isSprinting(): boolean

Whether the local player is sprinting.

Returns

boolean

The flag from the frame's state; synchronous.

Remarks

Partial: on the local player only. A streamed ped does not have it yet.

Example

const sprint = mp.players.local.isSprinting();

isStatic()

isStatic(): Promise<boolean>

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

Returns

Promise<boolean>

A Promise of true or false.

Example

const fixed = await entity.isStatic();

Inherited from

EntityMp.isStatic


isStill()

isStill(): Promise<boolean>

Whether the ped stands still.

Returns

Promise<boolean>

A Promise of true while the ped is still.

Remarks

Partial: read from this client's game.

Example

const still = await ped.isStill();

isStopped()

isStopped(): Promise<boolean>

Whether the ped is standing still (stopped).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const still = await ped.isStopped();

isStrafing()

isStrafing(): Promise<boolean>

Whether the ped strafes (moves sideways while facing a target).

Returns

Promise<boolean>

A Promise of true while the ped strafes.

Remarks

Partial: read from this client's game.

Example

const strafing = await ped.isStrafing();

isSwimming()

isSwimming(): Promise<boolean>

Whether the ped is swimming.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const swimming = await ped.isSwimming();

isSwimmingUnderWater()

isSwimmingUnderWater(): Promise<boolean>

Whether the ped is swimming under water.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const submerged = await ped.isSwimmingUnderWater();

isTouching()

isTouching(entity): Promise<boolean>

Whether the entity touches another entity.

Parameters

entity

number | EntityMp

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

Returns

Promise<boolean>

A Promise of true or false.

Example

const touching = await prop.isTouching(vehicle);

Inherited from

EntityMp.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

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

Inherited from

EntityMp.isTouchingModel


isTryingToEnterALockedVehicle()

isTryingToEnterALockedVehicle(): Promise<boolean>

Whether the ped is trying to enter a locked vehicle.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const locked = await ped.isTryingToEnterALockedVehicle();

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

const standing = await vehicle.isUpright(30);

Inherited from

EntityMp.isUpright


isUpsidedown()

isUpsidedown(): Promise<boolean>

Whether the entity is upside down.

Returns

Promise<boolean>

A Promise of true or false.

Example

const flipped = await vehicle.isUpsidedown();

Inherited from

EntityMp.isUpsidedown


isUsingActionMode()

isUsingActionMode(): Promise<boolean>

Whether the ped is using action mode.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const actionMode = await ped.isUsingActionMode();

isUsingAnyScenario()

isUsingAnyScenario(): Promise<boolean>

Whether the ped is using any scenario (an ambient animation or task).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const idle = await ped.isUsingAnyScenario();

isVaulting()

isVaulting(): Promise<boolean>

Whether the ped is vaulting (climbing over an obstacle).

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const vaulting = await ped.isVaulting();

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

const shown = await player.isVisible();

Inherited from

EntityMp.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

const shown = await entity.isVisibleToScript();

Inherited from

EntityMp.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

const waiting = await vehicle.isWaitingForWorldCollision();

Inherited from

EntityMp.isWaitingForWorldCollision


isWalking()

isWalking(): Promise<boolean>

Whether the ped walks.

Returns

Promise<boolean>

A Promise of true while the ped walks.

Remarks

Partial: read from this client's game.

Example

const walking = await ped.isWalking();

isWearingHelmet()

isWearingHelmet(): Promise<boolean>

Whether the ped wears a helmet.

Returns

Promise<boolean>

A promise of true if the ped wears a helmet.

Remarks

Partial: not yet confirmed in the game.

Example

if (await ped.isWearingHelmet()) mp.console.logInfo('helmet on');

knockOffProp()

knockOffProp(damaged, hats, glasses, helmets): void

Knocks the ped's props (a hat, glasses, a helmet) off.

Parameters

damaged

boolean

A flag of the game, passed on as it is.

hats

boolean

A flag of the game, passed on as it is.

glasses

boolean

A flag of the game, passed on as it is.

helmets

boolean

A flag of the game, passed on as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only. RAGE MP's names of the four flags are kept; what each does in VI is not confirmed.

Example

ped.knockOffProp(false, true, true, true);

knockOffVehicle()

knockOffVehicle(): void

Knocks the ped off its vehicle.

Returns

void

Example

ped.knockOffVehicle();

playFacialAnim()

playFacialAnim(animName, animDict): void

Makes the ped play a facial animation.

Parameters

animName

string

The animation's name.

animDict

string

The animation dictionary's name.

Returns

void

Remarks

Names are hashed as the game takes them; a streamed ped and the local player both take the call.

Example

ped.playFacialAnim('mood_happy_1', 'facials@gen_male@variations@normal');

registerHatedTargetsAround()

registerHatedTargetsAround(radius): void

Makes the ped hate the targets around it.

Parameters

radius

number

The radius, in metres.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.registerHatedTargetsAround(30);

registerTarget()

registerTarget(target): void

Registers a target for the ped: it will see and fight the given entity.

Parameters

target

number | EntityMp

The target entity.

Returns

void

Remarks

The third argument the game takes is set to 0 by SixL.

Example

ped.registerTarget(enemy);

removeDefensiveArea()

removeDefensiveArea(toggle): void

Removes the ped's defensive area (the area it guards).

Parameters

toggle

boolean

Whether to remove the area (true removes it).

Returns

void

Example

ped.removeDefensiveArea(true);

removeFromGroup()

removeFromGroup(): void

Removes the ped from its group.

Returns

void

Example

ped.removeFromGroup();

resetAlpha()

resetAlpha(): void

Restores the entity's opacity to the default.

Returns

void

Example

player.resetAlpha();

Inherited from

EntityMp.resetAlpha


resetLastVehicle()

resetLastVehicle(): void

Resets the ped's last vehicle.

Returns

void

Example

ped.resetLastVehicle();

resetMovementClipset()

resetMovementClipset(blendDuration): void

Gives the ped back its own movement clipset.

Parameters

blendDuration

number

The blend duration, a float.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.resetMovementClipset(0.25);

resetRagdollTimer()

resetRagdollTimer(): void

Resets the ped's ragdoll timer.

Returns

void

Remarks

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

Example

ped.resetRagdollTimer();

resetStrafeClipset()

resetStrafeClipset(): void

Gives the ped back its own strafing clipset.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.resetStrafeClipset();

resetVisibleDamage()

resetVisibleDamage(): void

Removes the ped's visible damage.

Returns

void

Remarks

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

Example

ped.resetVisibleDamage();

resetWeaponMovementClipset()

resetWeaponMovementClipset(): void

Gives the ped back its own clipset for moving with a weapon.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.resetWeaponMovementClipset();

resurrect()

resurrect(): void

Revives the ped, back to life.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.resurrect();

reviveInjured()

reviveInjured(): void

Revives an injured ped.

Returns

void

Remarks

Works on the local player, a remote player and a server ped. Partial: the game has the call but has not been checked in the running game yet.

Example

ped.reviveInjured();

setAccuracy()

setAccuracy(accuracy): void

Sets the ped's accuracy.

Parameters

accuracy

number

The accuracy value (the game's scale).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setAccuracy(50);

setAlertness()

setAlertness(value): void

Sets how alert the ped is.

Parameters

value

number

The alertness, as the game numbers it (an integer).

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.setAlertness(3);

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

player.setAlpha(128);

Inherited from

EntityMp.setAlpha


setAmmoInClip()

setAmmoInClip(weapon, ammo): void

Sets the ammunition in the clip of one of the ped's weapons.

Parameters

weapon

number

The weapon, a VI key.

ammo

number

The ammunition.

Returns

void

Remarks

Partial: not yet confirmed in the game. The weapon is a VI weapon key: GTA V weapon ids are not translated.

Example

ped.setAmmoInClip(weaponKey, 30);

setAsGroupLeader()

setAsGroupLeader(groupId): void

Makes the ped the leader of a group.

Parameters

groupId

number

The group, as createGroup or getGroupIndex gave it.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server. A group is a number this client got from createGroup or getGroupIndex (0 is no group); a number it never got is refused.

Example

mp.players.local.setAsGroupLeader(group);

setAsGroupMember()

setAsGroupMember(groupId): void

Makes the ped a member of a group.

Parameters

groupId

number

The group, as createGroup or getGroupIndex gave it.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server. A group is a number this client got from createGroup or getGroupIndex (0 is no group); a number it never got is refused.

Example

ped.setAsGroupMember(group);

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

entity.setAsMission(true, true);

Inherited from

EntityMp.setAsMission


setBlockingOfNonTemporaryEvents()

setBlockingOfNonTemporaryEvents(toggle): void

Allows or stops the ped from reacting to non-temporary events.

Parameters

toggle

boolean

true to block them.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setBlockingOfNonTemporaryEvents(true);

setCanArmIk()

setCanArmIk(toggle): void

Allows or forbids the ped's arm inverse kinematics (the game's arm IK: its hands follow targets).

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanArmIk(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

vehicle.setCanBeDamaged(false);

Inherited from

EntityMp.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

ped.setCanBeDamagedByRelationshipGroup(false, 'police');

Inherited from

EntityMp.setCanBeDamagedByRelationshipGroup


setCanBeDraggedOut()

setCanBeDraggedOut(toggle): void

Allows or forbids dragging the ped out of a vehicle.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

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

Example

ped.setCanBeDraggedOut(false);

setCanBeKnockedOffVehicle()

setCanBeKnockedOffVehicle(state): void

Allows or forbids the ped to be knocked off a vehicle.

Parameters

state

number

The game's state value (RAGE MP's state).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanBeKnockedOffVehicle(0);

setCanBeShotInVehicle()

setCanBeShotInVehicle(toggle): void

Allows or forbids shooting the ped in a vehicle.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

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

Example

ped.setCanBeShotInVehicle(false);

setCanBeTargetedWhenInjured()

setCanBeTargetedWhenInjured(toggle): void

Allows or forbids the ped to be targeted while injured.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanBeTargetedWhenInjured(true);

setCanBeTargetedWithoutLos()

setCanBeTargetedWithoutLos(toggle): void

Allows or forbids the ped to be targeted without line of sight.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server. The game call is the entity's (shared with other entities).

Example

ped.setCanBeTargetedWithoutLos(true);

Overrides

EntityMp.setCanBeTargetedWithoutLos


setCanHeadIk()

setCanHeadIk(toggle): void

Allows or forbids the ped's head inverse kinematics.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanHeadIk(true);

setCanPlayAmbientAnims()

setCanPlayAmbientAnims(toggle): void

Allows or forbids the ped's ambient (idle) animations.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanPlayAmbientAnims(true);

setCanPlayAmbientBaseAnims()

setCanPlayAmbientBaseAnims(toggle): void

Allows or forbids the ped's ambient base (base-level idle) animations.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanPlayAmbientBaseAnims(true);

setCanPlayGestureAnims()

setCanPlayGestureAnims(toggle): void

Allows or forbids the ped's gesture animations (waving, pointing ...).

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanPlayGestureAnims(true);

setCanRagdoll()

setCanRagdoll(toggle): void

Allows or forbids the ped to go into ragdoll (limp) state.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanRagdoll(true);

setCanRagdollFromPlayerImpact()

setCanRagdollFromPlayerImpact(toggle): void

Allows or forbids the ped to go into ragdoll from a player's impact.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanRagdollFromPlayerImpact(true);

setCanTeleportToGroupLeader()

setCanTeleportToGroupLeader(groupHandle, toggle): void

Allows or forbids the ped, a group member, to teleport to its leader when it is left far behind.

Parameters

groupHandle

number

The group, as createGroup or getGroupIndex gave it.

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server. A group is a number this client got from createGroup or getGroupIndex (0 is no group); a number it never got is refused.

Example

ped.setCanTeleportToGroupLeader(group, true);

setCanUseAutoConversationLookat()

setCanUseAutoConversationLookat(toggle): void

Allows or forbids the ped to use the automatic conversation look-at.

Parameters

toggle

boolean

true to allow.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCanUseAutoConversationLookat(true);

setCapsule()

setCapsule(value): void

Sets the ped's capsule (the size of its collision shape), as the game's value.

Parameters

value

number

The capsule's value; the game's unit, not converted by SixL.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCapsule(0.5);

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

vehicle.setCollision(false, true);

Inherited from

EntityMp.setCollision


setCombatAbility()

setCombatAbility(p1): void

Sets the ped's combat ability.

Parameters

p1

number

The ability level (the game's index, RAGE MP's p1).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCombatAbility(2);

setCombatAttributes()

setCombatAttributes(attributeIndex, enabled): void

Sets one of the ped's combat attributes on or off.

Parameters

attributeIndex

number

The attribute's index (the game's).

enabled

boolean

true to turn it on.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCombatAttributes(46, true);

setCombatFloat()

setCombatFloat(combatType, attribute): void

Sets a combat float value of the ped.

Parameters

combatType

number

The combat type index (the game's).

attribute

number

The value, the game's unit.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCombatFloat(0, 10);

setCombatMovement()

setCombatMovement(combatMovement): void

Sets the ped's combat movement mode.

Parameters

combatMovement

number

The mode (the game's index).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCombatMovement(1);

setCombatRange()

setCombatRange(p1): void

Sets the ped's combat range (how far it fights).

Parameters

p1

number

The range (the game's index, RAGE MP's p1).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setCombatRange(2);

setConfigFlag()

setConfigFlag(flagId, value): void

Sets one of the ped's configuration flags.

Parameters

flagId

number

The flag's id (the game's).

value

boolean

The flag's value.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setConfigFlag(32, true);

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

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

Inherited from

EntityMp.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, with the same one-move-per-frame rule for peds.

Example

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

Inherited from

EntityMp.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, including the one-move-per-frame rule for peds.

Example

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

Inherited from

EntityMp.setCoordsNoOffset


setDefensiveAreaDirection()

setDefensiveAreaDirection(p1, p2, p3, p4): void

Sets the direction of the ped's defensive area.

Parameters

p1

number

The x coordinate, in metres (RAGE MP's p1).

p2

number

The y coordinate, in metres (RAGE MP's p2).

p3

number

The z coordinate, in metres (RAGE MP's p3).

p4

boolean

The game's flag (RAGE MP's p4).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setDefensiveAreaDirection(0, 1, 0, false);

setDesiredHeading()

setDesiredHeading(heading): void

Sets the heading the ped turns to.

Parameters

heading

number

The heading. SixL passes the value to the game unchanged; the game's unit is not converted to degrees here.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setDesiredHeading(90);

setDesiredMoveBlendRatio()

setDesiredMoveBlendRatio(p1): void

Sets the move blend ratio the ped aims for.

Parameters

p1

number

The move blend ratio, as a float.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.setDesiredMoveBlendRatio(2.0);

setDriverAbility()

setDriverAbility(ability): void

Sets the ped's driving ability (as a driver).

Parameters

ability

number

The ability, the game's value.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setDriverAbility(1.0);

setDriverAggressiveness()

setDriverAggressiveness(aggressiveness): void

Sets the ped's driving aggressiveness (as a driver).

Parameters

aggressiveness

number

The aggressiveness, the game's value.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setDriverAggressiveness(0.5);

setDriveTaskCruiseSpeed()

setDriveTaskCruiseSpeed(cruiseSpeed): void

Sets the cruise speed of the ped's driving task.

Parameters

cruiseSpeed

number

The speed, in metres per second.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setDriveTaskCruiseSpeed(20);

setDriveTaskDrivingStyle()

setDriveTaskDrivingStyle(drivingStyle): void

Sets the driving style of the ped's driving task.

Parameters

drivingStyle

number

The style flags, as the game takes them.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setDriveTaskDrivingStyle(786603);

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

object.setDynamic(true);

Inherited from

EntityMp.setDynamic


setEnableBoundAnkles()

setEnableBoundAnkles(toggle): void

Allows or forbids the ped's bound ankles (its ankles are tied).

Parameters

toggle

boolean

true to bind the ankles.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setEnableBoundAnkles(true);

setEnableEnveffScale()

setEnableEnveffScale(toggle): void

Turns the scale of the ped's environmental effects on or off.

Parameters

toggle

boolean

true to turn it on.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setEnableEnveffScale(true);

setEnableHandcuffs()

setEnableHandcuffs(toggle): void

Enables or disables the ped's handcuffs.

Parameters

toggle

boolean

true to enable.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setEnableHandcuffs(true);

setEnableScuba()

setEnableScuba(toggle): void

Turns the ped's scuba gear on or off.

Parameters

toggle

boolean

true to turn it on.

Returns

void

Remarks

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

Example

ped.setEnableScuba(true);

setEnableWeaponBlocking()

setEnableWeaponBlocking(toggle): void

Turns the ped's weapon blocking on or off.

Parameters

toggle

boolean

true to turn it on.

Returns

void

Remarks

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

Example

ped.setEnableWeaponBlocking(true);

setFiringPattern()

setFiringPattern(patternHash): void

Sets the ped's firing pattern (how it fires its weapon).

Parameters

patternHash

string | number

The pattern's hash, or its name (hashed).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setFiringPattern(0xC2A8E3C1);

setFleeAttributes()

setFleeAttributes(attributes, p2): void

Sets how the ped flees.

Parameters

attributes

number

The flags.

p2

boolean

true to set them.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setFleeAttributes(0, false);

setGravity()

setGravity(toggle): void

Sets whether the ped is affected by gravity.

Parameters

toggle

boolean

true for gravity.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setGravity(true);

setGroupMemberPassengerIndex()

setGroupMemberPassengerIndex(index): void

Sets the ped's seat index in its group's vehicle.

Parameters

index

number

The seat's index.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setGroupMemberPassengerIndex(1);

setHasGravity()

setHasGravity(toggle): void

Turns the entity's gravity on or off.

Parameters

toggle

boolean

True for gravity, false for none.

Returns

void

Example

object.setHasGravity(false);

Inherited from

EntityMp.setHasGravity


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

player.setHeading(90);

Inherited from

EntityMp.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

player.setHealth(100);

Inherited from

EntityMp.setHealth


setHelmetPropIndex()

setHelmetPropIndex(propIndex, p2?): void

Sets which helmet the ped puts on.

Parameters

propIndex

number

The helmet, as VI's prop index (an integer).

p2?

boolean

A flag of the game, a bool.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.setHelmetPropIndex(0, false);

setHelmetTextureIndex()

setHelmetTextureIndex(textureIndex): void

Sets the texture of the helmet the ped puts on.

Parameters

textureIndex

number

The texture, as VI's index (an integer).

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.setHelmetTextureIndex(0);

setIkTarget()

setIkTarget(p1, targetPed, boneLookAt, x, y, z, p7, duration, duration1): void

Points a limb of the ped's inverse kinematics at an entity or a place.

Parameters

p1

number

The limb, as the game numbers it.

targetPed

number | { handle: number; }

An entity, or its handle (0 for none).

boneLookAt

number

The bone of the entity.

x

number

The offset X.

y

number

The offset Y.

z

number

The offset Z.

p7

any

The flags.

duration

number

The blend-in time.

duration1

number

The blend-out time.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setIkTarget(1, target, 0, 0, 0, 0, 0, 100, 100);

setIntoVehicle()

setIntoVehicle(vehicle, seatIndex): void

Puts the ped into a vehicle, in a seat.

Parameters

vehicle

number | EntityMp

The vehicle.

seatIndex

number

The seat's index, as the game's (passed on as it is).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setIntoVehicle(car, 0);

setInVehicleContext()

setInVehicleContext(context): void

Sets the ped's in-vehicle context.

Parameters

context

number

The context, a VI key.

Returns

void

Remarks

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

Example

ped.setInVehicleContext(contextKey);

setInvincible()

setInvincible(toggle): void

Makes the entity invincible or not.

Parameters

toggle

boolean

True for invincible, false to take damage.

Returns

void

Example

player.setInvincible(true);

Inherited from

EntityMp.setInvincible


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

ped.setIsTargetPriority(true);

Inherited from

EntityMp.setIsTargetPriority


setKeepTask()

setKeepTask(toggle): void

Allows or forbids the ped to keep its current task when it could drop it.

Parameters

toggle

boolean

true to keep the task.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setKeepTask(true);

setLegIkMode()

setLegIkMode(mode): void

Sets the ped's leg inverse kinematics mode.

Parameters

mode

number

The mode (the game's index).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setLegIkMode(0);

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

vehicle.setLoadCollisionFlag(true);

Inherited from

EntityMp.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

object.setLodDist(200);

Inherited from

EntityMp.setLodDist


setMaxHealth()

setMaxHealth(value): void

Sets the ped's maximum health.

Parameters

value

number

The maximum health (points).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server. The game call is the entity's (shared with other entities).

Example

ped.setMaxHealth(200);

Overrides

EntityMp.setMaxHealth


setMaxMoveBlendRatio()

setMaxMoveBlendRatio(value): void

Sets the ped's maximum move blend ratio (its top movement speed factor).

Parameters

value

number

The ratio (the game's factor).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setMaxMoveBlendRatio(3.0);

setMaxSpeed()

setMaxSpeed(speed): void

Sets the entity's maximum speed.

Parameters

speed

number

The maximum speed in metres per second.

Returns

void

Example

vehicle.setMaxSpeed(30);

Inherited from

EntityMp.setMaxSpeed


setMaxTimeInWater()

setMaxTimeInWater(value): void

Sets the ped's maximum time in water before it is affected.

Parameters

value

number

The time, the game's unit (passed on as it is).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setMaxTimeInWater(10);

setMaxTimeUnderwater()

setMaxTimeUnderwater(value): void

Sets the ped's maximum time underwater.

Parameters

value

number

The time, the game's unit (passed on as it is).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setMaxTimeUnderwater(30);

setMoney()

setMoney(amount): void

Sets the money the ped carries.

Parameters

amount

number

The amount.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setMoney(500);

setMountedWeaponTarget()

setMountedWeaponTarget(targetEntity, p2, x, y, z): void

Points the ped's mounted weapon at a target or a place.

Parameters

targetEntity

number | { handle: number; }

The target ped, or its handle.

p2

any

The target vehicle, or its handle (0 for none).

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

Returns

void

Remarks

Partial: not yet confirmed in the game. The last two arguments of the game's call have no place in VI: dropped.

Example

ped.setMountedWeaponTarget(target, 0, 0, 0, 0);

setMoveRateOverride()

setMoveRateOverride(value): void

Sets the ped's move rate override (how fast its movement animations play).

Parameters

value

number

The rate, the game's factor.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setMoveRateOverride(1.2);

setNoCollision()

setNoCollision(entity, collision): void

Stops the entity and another entity from colliding with each other.

Parameters

entity

number | EntityMp

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

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.setNoCollision


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

vehicle.setOnlyDamagedByPlayer(true);

Inherited from

EntityMp.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

ped.setOnlyDamagedByRelationshipGroup(true, 'police');

Inherited from

EntityMp.setOnlyDamagedByRelationshipGroup


setPlaysHeadOnHornAnimWhenDiesInVehicle()

setPlaysHeadOnHornAnimWhenDiesInVehicle(toggle): void

Sets whether the ped plays the horn animation when it dies in a vehicle.

Parameters

toggle

boolean

true to play it.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setPlaysHeadOnHornAnimWhenDiesInVehicle(true);

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

ped.setProofs(true, true, true, false, false, false, false, false);

Inherited from

EntityMp.setProofs


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. A quaternion read with getQuaternion and set back gives the same pose.

Example

object.setQuaternion(0, 0, 0.7071068, 0.7071068);

Inherited from

EntityMp.setQuaternion


setRagdollFlag()

setRagdollFlag(flag): void

Blocks ragdoll reasons for the ped.

Parameters

flag

number

The blocking flags.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setRagdollFlag(1);

setRelationshipGroupDefaultHash()

setRelationshipGroupDefaultHash(hash): void

Sets the ped's default relationship group hash.

Parameters

hash

string | number

The group's hash, or its name (hashed).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setRelationshipGroupDefaultHash('PLAYER');

setRelationshipGroupHash()

setRelationshipGroupHash(hash): void

Sets the ped's relationship group hash.

Parameters

hash

string | number

The group's hash, or its name (hashed).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setRelationshipGroupHash('PLAYER');

setResetFlag()

setResetFlag(flagId, doReset): void

Sets a reset flag of the ped for this frame.

Parameters

flagId

number

The flag.

doReset

boolean

Passed to the game as it is.

Returns

void

Remarks

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

Example

ped.setResetFlag(124, true);

setResetRagdollFlag()

setResetRagdollFlag(flag): void

Clears blocked ragdoll reasons of the ped.

Parameters

flag

number

The blocking flags to clear.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setResetRagdollFlag(1);

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

object.setRotation(0, 0, 90, 2, false);

Inherited from

EntityMp.setRotation


setScriptedAnimSeatOffset()

setScriptedAnimSeatOffset(p1): void

Sets the seat offset of the ped's scripted animation in a vehicle.

Parameters

p1

number

The offset, the game's value (RAGE MP's p1).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setScriptedAnimSeatOffset(0);

setShootRate()

setShootRate(shootRate): void

Sets the ped's shoot rate (how often it fires).

Parameters

shootRate

number

The rate (the game's value).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setShootRate(100);

setSphereDefensiveArea()

setSphereDefensiveArea(x, y, z, radius, p5, p6): void

Sets a spherical defensive area: the area the ped guards around a point.

Parameters

x

number

The centre's x, in metres.

y

number

The centre's y, in metres.

z

number

The centre's z, in metres.

radius

number

The radius, in metres.

p5

boolean

The game's flag (RAGE MP's p5).

p6

boolean

The game's flag (RAGE MP's p6).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setSphereDefensiveArea(0, 0, 70, 5, false, false);

setStrafeClipset()

setStrafeClipset(clipSet): void

Sets the clipset (a set of animation clips) the ped strafes with.

Parameters

clipSet

string | number

The clipset: its name or hash.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.setStrafeClipset('<clipset name>');

setSuffersCriticalHits()

setSuffersCriticalHits(toggle): void

Sets whether the ped suffers critical hits.

Parameters

toggle

boolean

true to turn it on.

Returns

void

Remarks

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

Example

ped.setSuffersCriticalHits(false);

setSweat()

setSweat(sweat): void

Sets the ped's sweat level.

Parameters

sweat

number

The sweat level (the game's value).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setSweat(0.5);

setTargetLossResponse()

setTargetLossResponse(responseType): void

Sets how the ped responds when it loses its target.

Parameters

responseType

number

The response's index (the game's).

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setTargetLossResponse(0);

setTaskVehicleChaseBehaviorFlag()

setTaskVehicleChaseBehaviorFlag(flag, set): void

Sets or clears a behaviour flag of the ped's vehicle chase.

Parameters

flag

number

The flag.

set

boolean

true to set it.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setTaskVehicleChaseBehaviorFlag(1, true);

setTaskVehicleChaseIdealPursuitDistance()

setTaskVehicleChaseIdealPursuitDistance(distance): void

Sets the distance the ped keeps in a vehicle chase.

Parameters

distance

number

The distance, in metres.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.setTaskVehicleChaseIdealPursuitDistance(30);

setToLoadCover()

setToLoadCover(toggle): void

Makes the ped load the cover around it, or stops it.

Parameters

toggle

boolean

true to turn it on.

Returns

void

Remarks

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

Example

ped.setToLoadCover(true);

setUsingActionMode()

setUsingActionMode(p1, p2, action): void

Sets whether the ped uses the action mode, with the given action.

Parameters

p1

boolean

The flag (RAGE MP's p1).

p2

number

The game's value (RAGE MP's p2), not used by SixL.

action

string

The action's name (RAGE MP's action); not used by SixL.

Returns

void

Remarks

Partial: SixL passes the flag and the game's integer; the third argument (the action name) is not taken.

Example

ped.setUsingActionMode(true, 0, '');

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

vehicle.setVelocity(0, 10, 0);

Inherited from

EntityMp.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

player.setVisible(false);

Inherited from

EntityMp.setVisible


setWeaponMovementClipset()

setWeaponMovementClipset(clipSet): void

Sets the clipset the ped moves with while it holds a weapon.

Parameters

clipSet

string | number

The clipset: its name or hash.

Returns

void

Remarks

Partial: not yet confirmed in the game; the change is made in this client's game only.

Example

ped.setWeaponMovementClipset('<clipset name>');

setWetnessEnabledThisFrame()

setWetnessEnabledThisFrame(): void

Makes the ped wet for this frame only.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setWetnessEnabledThisFrame();

setWetnessHeight()

setWetnessHeight(height): void

Sets the height of the ped's wetness (how high the water reaches on it).

Parameters

height

number

The height, the game's value.

Returns

void

Remarks

Partial: the change is made in this client's game only; it is not sent to the server.

Example

ped.setWetnessHeight(0.5);

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

ped.stopAnim('walk', 'move_m@', 0.5);

Inherited from

EntityMp.stopAnim


stopAnimPlayback()

stopAnimPlayback(p1, p2): void

Stops the animation playback of the ped.

Parameters

p1

number

A flag of the game, as an integer.

p2

boolean

A flag of the game, a bool.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.stopAnimPlayback(0, false);

stopWeaponFiringWhenDropped()

stopWeaponFiringWhenDropped(): void

Stops the ped's dropped weapon from firing.

Returns

void

Remarks

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

Example

ped.stopWeaponFiringWhenDropped();

taskAchieveHeading()

taskAchieveHeading(heading, timeout): void

Turns the ped to a heading.

Parameters

heading

number

The heading in degrees.

timeout

number

The time in milliseconds the ped has to turn.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskAchieveHeading(90, 2000);

taskArrest()

taskArrest(target): void

Makes the ped arrest another ped.

Parameters

target

number | { handle: number; }

The ped arrested, or its handle.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskArrest(target);

taskBoatMission()

taskBoatMission(boat, p2, p3, x, y, z, p7, maxSpeed, p9, p10, p11): void

Gives the ped, driving a boat, a mission.

Parameters

boat

number | { handle: number; }

The boat, or its handle.

p2

any

A target vehicle, or its handle (0 for none).

p3

any

A target ped, or its handle (0 for none).

x

number

The destination X.

y

number

The destination Y.

z

number

The destination Z.

p7

any

The mission, as the game numbers it.

maxSpeed

number

The speed.

p9

any

The driving style flags.

p10

number

Passed to the game as it is.

p11

any

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskBoatMission(boat, 0, 0, x, y, z, 4, 20, 786603, -1, 0);

taskClearLookAt()

taskClearLookAt(): void

Clears the look-at target of the ped, so it looks where it normally looks.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskClearLookAt();

taskClimb()

taskClimb(unused): void

Makes the ped climb an obstacle in front of it.

Parameters

unused

boolean

A flag the game takes (RAGE MP names it unused).

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskClimb(true);

taskCombat()

taskCombat(targetPed, p2, p3): void

Makes the ped fight another ped.

Parameters

targetPed

number | { handle: number; }

The ped fought, or its handle.

p2

number

The combat flags.

p3

number

The threat response flags.

Returns

void

Remarks

Partial: not yet confirmed in the game. The game takes two more numbers: 0.

Example

ped.taskCombat(target, 0, 16);

taskCower()

taskCower(duration): void

Makes the ped cower (crouch and cover its head) for a time.

Parameters

duration

number

The time in milliseconds.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskCower(3000);

taskDriveBy()

taskDriveBy(targetPed, p2, targetX, targetY, targetZ, p6, p7, p8, firingPattern): void

Makes the ped shoot from a vehicle at a target or a place.

Parameters

targetPed

number | { handle: number; }

The target ped, or its handle (0 for none).

p2

any

The target vehicle, or its handle (0 for none).

targetX

number

The place X.

targetY

number

The place Y.

targetZ

number

The place Z.

p6

number

The distance to shoot from.

p7

any

The accuracy.

p8

boolean

Passed to the game as it is.

firingPattern

number

The firing pattern, a VI key.

Returns

void

Remarks

Partial: not yet confirmed in the game. The firing pattern is a VI key.

Example

ped.taskDriveBy(target, 0, 0, 0, 0, 50, 100, false, pattern);

taskEnterVehicle()

taskEnterVehicle(vehicle, timeout, seat, speed, flag, p6?): void

Makes the ped enter a vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

timeout

number

The time in milliseconds the ped has to get in.

seat

number

The seat to enter, as an integer (-1 for the driver).

speed

number

The speed of the move, as a float.

flag

number

A flag of the game, as an integer.

p6?

number

Not used by SixL: accepted for compatibility.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskEnterVehicle(vehicle, 10000, -1, 1.0, 1, 0);

taskFollowToOffsetOf()

taskFollowToOffsetOf(entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing): void

Makes the ped follow an entity, keeping an offset from it.

Parameters

entity

number | { handle: number; }

The entity to follow, or its handle.

offsetX

number

The offset along the entity's X axis, in metres.

offsetY

number

The offset along the entity's Y axis, in metres.

offsetZ

number

The offset along the entity's Z axis, in metres.

movementSpeed

number

The speed, as a float (the game's move speed).

timeout

number

The time in milliseconds the task runs; -1 for no limit.

stoppingRange

number

The distance in metres at which the ped stops.

persistFollowing

boolean

Whether the ped keeps following once it is there.

Returns

void

Remarks

Partial: not yet confirmed in the game; the task runs in this client's game only.

Example

ped.taskFollowToOffsetOf(other, 0, -2, 0, 1.0, -1, 1.0, true);

taskForceMotionState()

taskForceMotionState(state, p2): void

Forces the ped into a motion state.

Parameters

state

string | number

The motion state's hash, or its name.

p2

boolean

A flag of the game, a bool.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskForceMotionState('MotionState_Idle', false);

taskGoToCoordAnyMeans()

taskGoToCoordAnyMeans(x, y, z, speed, p5, p6, walkingStyle, p8): void

Makes the ped walk or run to a point, by any means.

Parameters

x

number

The destination's X coordinate, in metres.

y

number

The destination's Y coordinate, in metres.

z

number

The destination's Z coordinate, in metres.

speed

number

The speed, as a float (the game's move speed).

p5

number | { handle: number; }

An entity the move uses, or its handle; 0 or null when none.

p6

boolean

A flag of the game, a bool.

walkingStyle

string | number

The walking style: a hash of the game's walking style, or its name.

p8

number

A flag of the game, a float.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskGoToCoordAnyMeans(0, 0, 70, 2.0, 0, false, 0, 0.5);

taskGoToCoordAnyMeansExtraParams()

taskGoToCoordAnyMeansExtraParams(x, y, z, speed, p5, p6, walkingStyle, p8, p9?, p10?, p11?, p12?): void

Makes the ped walk or run to a point, by any means, with more parameters of the game.

Parameters

x

number

The destination's X coordinate, in metres.

y

number

The destination's Y coordinate, in metres.

z

number

The destination's Z coordinate, in metres.

speed

number

The speed, as a float (the game's move speed).

p5

number | { handle: number; }

An entity the move uses, or its handle; 0 or null when none.

p6

boolean

A flag of the game, a bool.

walkingStyle

string | number

The walking style: a hash of the game's walking style, or its name.

p8

number

A value of the game, a float.

p9?

number

A value of the game, a float.

p10?

number

A value of the game, a float.

p11?

number

A value of the game, an integer.

p12?

number

A value of the game, a float.

Returns

void

Remarks

Partial: not yet confirmed in the game; the task runs in this client's game only.

Example

ped.taskGoToCoordAnyMeansExtraParams(0, 0, 70, 2.0, 0, false, 0, 0.5, 0, 0, 0);

taskGoToCoordAnyMeansExtraParamsWithCruiseSpeed()

taskGoToCoordAnyMeansExtraParamsWithCruiseSpeed(x, y, z, speed, p5, p6, walkingStyle, p8, p9, p10, p11, p12): void

Makes the ped go to a place by any means, with extra settings and a cruise speed.

Parameters

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

speed

number

The speed.

p5

any

A vehicle, or its handle (0 for none).

p6

boolean

Passed to the game as it is.

walkingStyle

number

The walking style, a VI key.

p8

number

Passed to the game as it is.

p9

any

Passed to the game as it is.

p10

any

Passed to the game as it is.

p11

any

Passed to the game as it is.

p12

any

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game. The walking style is a VI key.

Example

ped.taskGoToCoordAnyMeansExtraParamsWithCruiseSpeed(x, y, z, 2, 0, false, 0, -1, 0, 0, 0, 0);

taskGuardCurrentPosition()

taskGuardCurrentPosition(p1, p2, p3): void

Makes the ped guard its current position.

Parameters

p1

number

A radius-like value of the game, as a float.

p2

number

A radius-like value of the game, as a float.

p3

number | boolean

A flag of the game, a bool (a number is taken as one).

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskGuardCurrentPosition(10, 10, true);

taskHandsUp()

taskHandsUp(duration, facingPed, p3, p4): void

Makes the ped raise its hands, facing another ped.

Parameters

duration

number

The time in milliseconds the hands stay up.

facingPed

number | { handle: number; }

The ped to face, or its handle.

p3

number

A flag of the game, as an integer.

p4

number | boolean

A flag of the game, as an integer.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskHandsUp(5000, other, 0, 0);

taskHeliChase()

taskHeliChase(entityToFollow, x, y, z): void

Makes the ped, flying a helicopter, chase an entity at an offset.

Parameters

entityToFollow

number | { handle: number; }

The entity to chase, or its handle.

x

number

The offset X.

y

number

The offset Y.

z

number

The offset Z.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskHeliChase(target, 0, 0, 20);

taskJump()

taskJump(unused, flag1?, flag2?): void

Makes the ped jump.

Parameters

unused

boolean

A flag the game takes (RAGE MP names it unused).

flag1?

number | boolean

Not used by SixL: accepted for compatibility.

flag2?

number | boolean

Not used by SixL: accepted for compatibility.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskJump(true);

taskLeaveAnyVehicle()

taskLeaveAnyVehicle(p1, flags): void

Makes the ped leave any vehicle it is in.

Parameters

p1

number

A flag of the game, as an integer.

flags

number

The flags of the exit, as an integer bit mask.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskLeaveAnyVehicle(0, 0);

taskLeaveVehicle()

taskLeaveVehicle(vehicle, flags): void

Makes the ped leave a vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

flags

number

The flags of the exit, as an integer bit mask.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskLeaveVehicle(vehicle, 0);

taskOpenVehicleDoor()

taskOpenVehicleDoor(vehicle, timeOut, seat, speed): void

Makes the ped open a vehicle's door.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

timeOut

number

The time in milliseconds the ped has to open the door.

seat

number

The seat whose door opens, as an integer.

speed

number

The speed of the opening, as a float.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskOpenVehicleDoor(vehicle, 5000, 0, 1.0);

taskParachute()

taskParachute(p1, p2?): void

Makes the ped open a parachute.

Parameters

p1

boolean

A flag of the game, a bool.

p2?

boolean

A flag of the game, a bool.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskParachute(false, false);

taskPause()

taskPause(ms): void

Makes the ped stand still for a time.

Parameters

ms

number

The time in milliseconds.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskPause(2000);

taskPerformSequence()

taskPerformSequence(taskSequenceId): void

Makes the ped carry out a task sequence (a list of tasks the game runs one after another).

Parameters

taskSequenceId

number

The sequence's id, as an integer.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskPerformSequence(sequenceId);

taskPutDirectlyIntoCover()

taskPutDirectlyIntoCover(x, y, z, timeout, p5, p6, p7, p8, p9, p10): void

Puts the ped straight into cover at a place.

Parameters

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

timeout

any

How long, in milliseconds (-1: until stopped).

p5

boolean

Whether the ped may peek and fire.

p6

number

The blend-in time.

p7

boolean

Passed to the game as it is.

p8

boolean

Passed to the game as it is.

p9

object

A number passed to the game (0 when not a number).

p10

boolean

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game. The game takes two more flags: false.

Example

ped.taskPutDirectlyIntoCover(x, y, z, -1, false, 0, false, false, 0, false);

taskRappelFromHeli()

taskRappelFromHeli(p1): void

Makes the ped rappel down from the helicopter it sits in.

Parameters

p1

number

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskRappelFromHeli(10);

taskReloadWeapon()

taskReloadWeapon(doReload): void

Makes the ped reload its weapon.

Parameters

doReload

boolean

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskReloadWeapon(true);

taskSetBlockingOfNonTemporaryEvents()

taskSetBlockingOfNonTemporaryEvents(toggle): void

Sets whether the ped blocks its non-temporary events (events that change its long-term behaviour).

Parameters

toggle

boolean

true to block such events, false to let them through.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskSetBlockingOfNonTemporaryEvents(true);

taskShockingEventReact()

taskShockingEventReact(eventHandle): void

Makes the ped react to a shocking event (one it has seen or heard).

Parameters

eventHandle

number

The event's handle, as an integer.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskShockingEventReact(eventHandle);

taskShuffleToNextVehicleSeat()

taskShuffleToNextVehicleSeat(vehicle, p2?): void

Makes the ped move to the next free seat of a vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

p2?

number

A flag of the game, as an integer.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskShuffleToNextVehicleSeat(vehicle, 0);

taskSkyDive()

taskSkyDive(p1?): void

Makes the ped skydive from a plane.

Parameters

p1?

boolean

A flag of the game, a bool.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskSkyDive(false);

taskStandStill()

taskStandStill(time): void

Makes the ped stand still.

Parameters

time

number

The time in milliseconds the ped stands still.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskStandStill(5000);

taskStartScenarioAtPosition()

taskStartScenarioAtPosition(scenarioName, x, y, z, heading, duration, sittingScenario, teleport): void

Makes the ped play a scenario at a place.

Parameters

scenarioName

string

The scenario, by name.

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

heading

number

The heading.

duration

number

How long, in milliseconds (-1: until stopped).

sittingScenario

boolean

Whether it is a sitting one.

teleport

boolean

Whether the ped is put there at once.

Returns

void

Remarks

Partial: not yet confirmed in the game. The scenario is VI's: its name is hashed to the key VI takes.

Example

ped.taskStartScenarioAtPosition(scenario, x, y, z, 0, -1, false, true);

taskTurnToFace()

taskTurnToFace(entity, duration): void

Turns the ped to face an entity.

Parameters

entity

number | { handle: number; }

The entity to face, or its handle.

duration

number

The time in milliseconds the turn takes.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskTurnToFace(vehicle, 1000);

taskTurnToFaceCoord()

taskTurnToFaceCoord(x, y, z, duration): void

Turns the ped to face a point.

Parameters

x

number

The point's X coordinate, in metres.

y

number

The point's Y coordinate, in metres.

z

number

The point's Z coordinate, in metres.

duration

number

The time in milliseconds the turn takes.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskTurnToFaceCoord(0, 0, 70, 1000);

taskUseNearestScenarioToCoordWarp()

taskUseNearestScenarioToCoordWarp(x, y, z, radius, p5): void

Makes the ped use the nearest scenario to a point, moving it there first.

Parameters

x

number

The point's X coordinate, in metres.

y

number

The point's Y coordinate, in metres.

z

number

The point's Z coordinate, in metres.

radius

number

The search radius, in metres.

p5

number

A flag of the game, as an integer.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskUseNearestScenarioToCoordWarp(0, 0, 70, 20, 0);

taskVehicleAimAt()

taskVehicleAimAt(target): void

Makes the ped aim the vehicle's weapons at another ped.

Parameters

target

number | { handle: number; }

The ped aimed at, or its handle.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleAimAt(target);

taskVehicleChase()

taskVehicleChase(targetEnt): void

Makes the ped, driving, chase an entity.

Parameters

targetEnt

number | { handle: number; }

The entity to chase, or its handle.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleChase(target);

taskVehicleDriveToCoord()

taskVehicleDriveToCoord(vehicle, x, y, z, speed, p6, vehicleModel, drivingMode, stopRange, p10): void

Makes the ped drive a vehicle to a place.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

speed

number

The speed.

p6

any

Passed to the game as it is.

vehicleModel

number

The vehicle model, a VI key.

drivingMode

number

The driving style flags.

stopRange

number

The distance to stop at.

p10

number

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game. The model is a VI key.

Example

ped.taskVehicleDriveToCoord(vehicle, x, y, z, 20, 1, model, 786603, 5, 0);

taskVehicleDriveWander()

taskVehicleDriveWander(vehicle, speed, drivingStyle): void

Makes the ped drive a vehicle around aimlessly.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

speed

number

The speed, in metres per second.

drivingStyle

number

The style flags.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleDriveWander(vehicle, 15, 786603);

taskVehicleEscort()

taskVehicleEscort(vehicle, targetVehicle, mode, speed, drivingStyle, minDistance, p7, noRoadsDistance): void

Makes the ped escort another vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

targetVehicle

number | { handle: number; }

The vehicle escorted, or its handle.

mode

number

The mode.

speed

number

The speed.

drivingStyle

number

The driving style flags.

minDistance

number

The distance kept.

p7

number

Not used.

noRoadsDistance

number

Not used.

Returns

void

Remarks

Partial: not yet confirmed in the game. The last two arguments have no place in VI: dropped.

Example

ped.taskVehicleEscort(vehicle, target, -1, 20, 786603, 5, 0, 20);

taskVehicleFollow()

taskVehicleFollow(vehicle, targetEntity, drivingStyle, speed, minDistance): void

Makes the ped follow an entity in a vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

targetEntity

number | { handle: number; }

The entity to follow, or its handle.

drivingStyle

number

The style flags.

speed

number

The speed, in metres per second.

minDistance

number

The distance kept, in metres.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleFollow(vehicle, target, 786603, 20, 10);

taskVehicleGotoNavmesh()

taskVehicleGotoNavmesh(vehicle, x, y, z, speed, behaviorFlag, stoppingRange): void

Makes the ped drive a vehicle to a place along the navigation mesh.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

speed

number

The speed.

behaviorFlag

number

The flags.

stoppingRange

number

The distance to stop at.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleGotoNavmesh(vehicle, x, y, z, 10, 156, 5);

taskVehicleMissionCoorsTarget()

taskVehicleMissionCoorsTarget(vehicle, x, y, z, p5, p6, p7, p8, p9, p10): void

Gives the ped, driving, a mission towards a place.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

p5

number

The mission, as the game numbers it.

p6

number

The cruise speed.

p7

number

The driving style flags.

p8

number

The distance at which it is reached.

p9

number

The straight-line distance.

p10

boolean

Whether to drive against the traffic.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleMissionCoorsTarget(vehicle, x, y, z, 4, 20, 786603, 5, 10, false);

taskVehicleMissionTarget()

taskVehicleMissionTarget(vehicle, pedTarget, mode, maxSpeed, drivingStyle, minDistance, p7, p8): void

Gives the ped, driving, a mission against another ped.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

pedTarget

number | { handle: number; }

The target ped, or its handle.

mode

number

The mission, as the game numbers it.

maxSpeed

number

The speed.

drivingStyle

number

The driving style flags.

minDistance

number

The distance kept.

p7

number

Passed to the game as it is.

p8

boolean

Passed to the game as it is.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleMissionTarget(vehicle, target, 7, 30, 786603, 10, 0, false);

taskVehiclePark()

taskVehiclePark(vehicle, x, y, z, heading, mode, radius, keepEngineOn): void

Makes the ped park a vehicle.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

x

number

The place X.

y

number

The place Y.

z

number

The place Z.

heading

number

The heading.

mode

number

The mode.

radius

number

The radius.

keepEngineOn

boolean

Whether the engine keeps running.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehiclePark(vehicle, x, y, z, 90, 0, 20, false);

taskVehicleTempAction()

taskVehicleTempAction(vehicle, action, time): void

Makes the ped do a short driving action (brake, turn, reverse ...).

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

action

number

The action, as the game numbers it.

time

number

How long, in milliseconds.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.taskVehicleTempAction(vehicle, 1, 1000);

taskWanderInArea()

taskWanderInArea(x, y, z, radius, minimalLength, timeBetweenWalks): void

Makes the ped wander at random inside a circle.

Parameters

x

number

The circle's centre X coordinate, in metres.

y

number

The circle's centre Y coordinate, in metres.

z

number

The circle's centre Z coordinate, in metres.

radius

number

The circle's radius, in metres.

minimalLength

number

The minimum length of a walk, in metres.

timeBetweenWalks

number

The time between walks, in milliseconds.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskWanderInArea(0, 0, 70, 20, 5, 1000);

taskWanderStandard()

taskWanderStandard(p1, p2): void

Makes the ped wander on its own, with the game's standard wandering.

Parameters

p1

number

A flag of the game, a float.

p2

number

A flag of the game, as an integer.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskWanderStandard(10, 0);

taskWarpIntoVehicle()

taskWarpIntoVehicle(vehicle, seat): void

Puts the ped into a vehicle seat at once, without an animation.

Parameters

vehicle

number | { handle: number; }

The vehicle, or its handle.

seat

number

The seat, as an integer (-1 for the driver).

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.taskWarpIntoVehicle(vehicle, -1);

uncuff()

uncuff(): void

Takes the cuffs off the ped.

Returns

void

Remarks

Partial: not yet confirmed in the game.

Example

ped.uncuff();

updateTaskHandsUpDuration()

updateTaskHandsUpDuration(duration): void

Changes the duration of the ped's hands-up task that is running.

Parameters

duration

number

The new time in milliseconds.

Returns

void

Remarks

Partial: the task runs in this client's game only; it is not sent to the server.

Example

ped.updateTaskHandsUpDuration(8000);

wasKilledByStealth()

wasKilledByStealth(): Promise<boolean>

Whether the ped was killed by a stealth kill.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const sneaky = await ped.wasKilledByStealth();

wasKilledByTakedown()

wasKilledByTakedown(): Promise<boolean>

Whether the ped was killed by a takedown.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const takedown = await ped.wasKilledByTakedown();

wasSkeletonUpdated()

wasSkeletonUpdated(): Promise<boolean>

Whether the ped's skeleton was updated in this frame.

Returns

Promise<boolean>

A promise of the flag; asynchronous, from the game.

Example

const updated = await ped.wasSkeletonUpdated();