fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Client / Ped

Class: Ped

Represents a pedestrian character (Ped) in the game world.

Extends

Constructors

new Ped()

new Ped(owner): Ped

Parameters

owner: number

Returns

Ped

Overrides

Entity.constructor

Defined in

client/models/Ped.ts:53

Accessors

AttachedBlip

get AttachedBlip(): Blip

Retrieves the attached blip for the entity. If a valid blip handle exists for the entity, it returns a new Blip instance; otherwise, it returns null.

Returns

Blip

The attached Blip instance or null if no valid blip exists.

Inherited from

Entity.AttachedBlip

Defined in

client/models/Entity.ts:456


Bones

get Bones(): PedBoneCollection

Retrieves the EntityBoneCollection associated with this entity.

Returns

PedBoneCollection

Entity Bone Collection of Entity

Overrides

Entity.Bones

Defined in

client/models/Ped.ts:61


CanRagdoll

get CanRagdoll(): boolean

set CanRagdoll(value): void

Parameters

value: boolean

Returns

boolean

Defined in

client/models/Ped.ts:560


CurrentVehicle

get CurrentVehicle(): Vehicle

Returns

Vehicle

Defined in

client/models/Ped.ts:98


DrivingSpeed

set DrivingSpeed(value): void

Parameters

value: number

Defined in

client/models/Ped.ts:379


DrivingStyle

get DrivingStyle(): DrivingStyle

set DrivingStyle(style): void

Parameters

style: DrivingStyle

Returns

DrivingStyle

Defined in

client/models/Ped.ts:69


DropsWeaponsOnDeath

set DropsWeaponsOnDeath(value): void

Parameters

value: boolean

Defined in

client/models/Ped.ts:375


FiringPattern

set FiringPattern(value): void

Parameters

value: number

Defined in

client/models/Ped.ts:371


Handle

get Handle(): number

Gets the handle value.

Returns

number

The handle value as a number.

Inherited from

Entity.Handle

Defined in

client/models/Entity.ts:22


HasCollided

get HasCollided(): boolean

Checks if the entity with the specified handle has collided with anything.

Returns

boolean

Returns true if the entity has collided with anything, otherwise false.

Inherited from

Entity.HasCollided

Defined in

client/models/Entity.ts:422


HasGravity

set HasGravity(value): void

Sets whether the entity has gravity.

Parameters

value: boolean

A boolean value indicating whether the entity should have gravity.

Inherited from

Entity.HasGravity

Defined in

client/models/Entity.ts:233


Heading

get Heading(): number

Retrieves the current heading of the entity.

set Heading(heading): void

Sets the heading of an entity to a specified value.

Parameters

heading: number

The new heading value for the entity.

Returns

number

The heading of the entity.

Inherited from

Entity.Heading

Defined in

client/models/Entity.ts:171


Health

get Health(): number

Retrieves the current health of the entity.

set Health(health): void

Retrieves the current health of the entity.

Parameters

health: number

Returns

number

The health of the entity.

Overrides

Entity.Health

Defined in

client/models/Ped.ts:82


HeightAboveGround

get HeightAboveGround(): number

Calculates and returns the height of the entity above the ground level.

Returns

number

The height of the entity above the ground.

Inherited from

Entity.HeightAboveGround

Defined in

client/models/Entity.ts:242


IsAimingFromCover

get IsAimingFromCover(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:359


IsAlive

get IsAlive(): boolean

Checks the living status of the entity.

Returns

boolean

Returns true if the entity is alive, otherwise false.

Inherited from

Entity.IsAlive

Defined in

client/models/Entity.ts:97


IsAmbientSpeechEnabled

get IsAmbientSpeechEnabled(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:319


IsAmbientSpeechPlaying

get IsAmbientSpeechPlaying(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:307


IsAnySpeechPlaying

get IsAnySpeechPlaying(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:315


IsBeingJacked

get IsBeingJacked(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:275


IsBeingStealthKilled

get IsBeingStealthKilled(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:351


IsBeingStunned

get IsBeingStunned(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:347


IsClimbing

get IsClimbing(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:183


IsCollisionEnabled

get IsCollisionEnabled(): boolean

Checks if collision is enabled for

set IsCollisionEnabled(value): void

Enables or disables collision detection for the entity.

Parameters

value: boolean

A boolean indicating whether collision should be enabled (true) or disabled (false).

Returns

boolean

Inherited from

Entity.IsCollisionEnabled

Defined in

client/models/Entity.ts:428


IsCuffed

get IsCuffed(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:141


IsDead

get IsDead(): boolean

Checks whether the entity is dead.

Returns

boolean

Returns true if the entity is dead, otherwise false.

Inherited from

Entity.IsDead

Defined in

client/models/Entity.ts:88


IsDiving

get IsDiving(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:211


IsDoingDriveBy

get IsDoingDriveBy(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:339


IsDucking

get IsDucking(): boolean

set IsDucking(value): void

Parameters

value: boolean

Returns

boolean

Defined in

client/models/Ped.ts:175


IsEnemy

set IsEnemy(value): void

Parameters

value: boolean

Defined in

client/models/Ped.ts:129


IsFalling

get IsFalling(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:191


IsFleeing

get IsFleeing(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:291


IsGettingIntoAVehicle

get IsGettingIntoAVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:279


IsGettingUp

get IsGettingUp(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:179


IsGoingIntoCover

get IsGoingIntoCover(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:343


IsHuman

get IsHuman(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:125


IsIdle

get IsIdle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:153


IsInAir

get IsInAir(): boolean

Determines if the entity is currently in the air.

Returns

boolean

A boolean value indicating whether the entity is airborne.

Inherited from

Entity.IsInAir

Defined in

client/models/Entity.ts:333


IsInBoat

get IsInBoat(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:263


IsInCombat

get IsInCombat(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:295


IsInCoverFacingLeft

get IsInCoverFacingLeft(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:367


IsInFlyingVehicle

get IsInFlyingVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:259


IsInGroup

get IsInGroup(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:449


IsInHeli

get IsInHeli(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:251


IsInjured

get IsInjured(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:287


IsInMeleeCombat

get IsInMeleeCombat(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:299


IsInParachuteFreeFall

get IsInParachuteFreeFall(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:215


IsInPlane

get IsInPlane(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:255


IsInPoliceVehicle

get IsInPoliceVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:267


IsInStealthMode

get IsInStealthMode(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:303


IsInSub

get IsInSub(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:239


IsInTaxi

get IsInTaxi(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:243


IsInTrain

get IsInTrain(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:247


IsInvincible

set IsInvincible(value): void

Sets the invincibility status of the entity.

Parameters

value: boolean

A boolean value where true makes the entity invincible and false removes invincibility.

Inherited from

Entity.IsInvincible

Defined in

client/models/Entity.ts:379


IsInWater

get IsInWater(): boolean

Determines if the entity represented by this instance is in water.

Returns

boolean

True if the entity is in water, otherwise false.

Inherited from

Entity.IsInWater

Defined in

client/models/Entity.ts:342


IsJacking

get IsJacking(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:271


IsJumping

get IsJumping(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:187


IsJumpingOutOfVehicle

get IsJumpingOutOfVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:113


IsOccluded

get IsOccluded(): boolean

Checks if the current entity is occluded.

This method determines whether the entity associated with the current instance is occluded, meaning it is blocked from view by other objects or entities.

Returns

boolean

Inherited from

Entity.IsOccluded

Defined in

client/models/Entity.ts:299


IsOnBike

get IsOnBike(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:231


IsOnFire

get IsOnFire(): boolean

Checks if the entity is currently on fire.

Returns

boolean

Inherited from

Entity.IsOnFire

Defined in

client/models/Entity.ts:370


IsOnFoot

get IsOnFoot(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:235


IsOnlyDamagedByPlayer

set IsOnlyDamagedByPlayer(value): void

Modifies the entity to only take damage from players.

Parameters

value: boolean

If true, the entity will only be damaged by players; otherwise, it can be damaged by other sources.

Inherited from

Entity.IsOnlyDamagedByPlayer

Defined in

client/models/Entity.ts:388


IsOnScreen

get IsOnScreen(): boolean

Checks if the entity represented by this object is currently visible on the screen.

Returns

boolean

True if the entity is on the screen, false otherwise.

Inherited from

Entity.IsOnScreen

Defined in

client/models/Entity.ts:308


IsPainAudioEnabled

set IsPainAudioEnabled(value): void

Parameters

value: boolean

Defined in

client/models/Ped.ts:323


IsPerformingStealthKill

get IsPerformingStealthKill(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:355


IsPersistent

get IsPersistent(): boolean

Determines whether the current entity is persistent.

set IsPersistent(value): void

Parameters

value: boolean

Returns

boolean

True if the entity is persistent; otherwise, false.

Inherited from

Entity.IsPersistent

Defined in

client/models/Entity.ts:351


IsPlantingBomb

get IsPlantingBomb(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:327


IsPlayer

get IsPlayer(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:137


IsPositionFrozen

set IsPositionFrozen(value): void

Sets the frozen state of the entity’s position.

Parameters

value: boolean

If true, the entity’s position will be frozen. If false, the entity’s position will be unfrozen.

Inherited from

Entity.IsPositionFrozen

Defined in

client/models/Entity.ts:189


IsPriorityTargetForEnemies

set IsPriorityTargetForEnemies(value): void

Parameters

value: boolean

Defined in

client/models/Ped.ts:133


IsProne

get IsProne(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:167


IsRagdoll

get IsRagdoll(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:149


IsRecordingCollisions

set IsRecordingCollisions(value): void

Sets whether the entity is recording collisions.

Parameters

value: boolean

A boolean indicating whether the entity should record collisions.

Inherited from

Entity.IsRecordingCollisions

Defined in

client/models/Entity.ts:446


IsReloading

get IsReloading(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:335


IsRunning

get IsRunning(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:203


IsScriptedSpeechPlaying

get IsScriptedSpeechPlaying(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:311


IsShooting

get IsShooting(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:331


IsSprinting

get IsSprinting(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:207


IsStopped

get IsStopped(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:195


IsSwimming

get IsSwimming(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:219


IsSwimmingUnderWater

get IsSwimmingUnderWater(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:223


IsTryingToEnterALockedVehicle

get IsTryingToEnterALockedVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:283


IsUpright

get IsUpright(): boolean

Checks if the entity is in an upright position.

Returns

boolean

True if the entity is upright, false otherwise.

Inherited from

Entity.IsUpright

Defined in

client/models/Entity.ts:317


IsUpsideDown

get IsUpsideDown(): boolean

Determines if the entity is upside down. This method checks the orientation

Returns

boolean

Inherited from

Entity.IsUpsideDown

Defined in

client/models/Entity.ts:324


IsVaulting

get IsVaulting(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:227


IsVisible

get IsVisible(): boolean

Check if the entity is currently visible.

set IsVisible(value): void

Sets the visibility of the entity.

Parameters

value: boolean

A boolean value indicating whether the entity should be visible.

Returns

boolean

True if the entity is visible, otherwise false.

Inherited from

Entity.IsVisible

Defined in

client/models/Entity.ts:278


IsWalking

get IsWalking(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:199


IsWearingHelmet

get IsWearingHelmet(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:145


Jacker

get Jacker(): Ped

Returns

Ped

Defined in

client/models/Ped.ts:411


JackTarget

get JackTarget(): Ped

Returns

Ped

Defined in

client/models/Ped.ts:415


Killer

get Killer(): Entity

Returns

Entity

Defined in

client/models/Ped.ts:423


LastVehicle

get LastVehicle(): Vehicle

Returns

Vehicle

Defined in

client/models/Ped.ts:103


LodDistance

get LodDistance(): number

Retrieves the Level of Detail (LOD) distance for the current entity.

set LodDistance(value): void

Sets the Level of Detail (LOD) distance for the entity.

Parameters

value: number

The distance at which the entity will switch LOD models.

Returns

number

The LOD distance of the entity.

Inherited from

Entity.LodDistance

Defined in

client/models/Entity.ts:260


MaxDrivingSpeed

set MaxDrivingSpeed(value): void

Parameters

value: number

Defined in

client/models/Ped.ts:121


MaxHealth

get MaxHealth(): number

Retrieves the maximum health value of an entity.

set MaxHealth(amount): void

Retrieves the maximum health value of an entity.

Parameters

amount: number

Returns

number

The maximum health of the entity.

Overrides

Entity.MaxHealth

Defined in

client/models/Ped.ts:90


MaxSpeed

set MaxSpeed(value): void

Sets the maximum speed for the entity.

Parameters

value: number

The maximum speed to be set for the entity.

Inherited from

Entity.MaxSpeed

Defined in

client/models/Entity.ts:224


MeleeTarget

get MeleeTarget(): Ped

Returns

Ped

Defined in

client/models/Ped.ts:419


Model

get Model(): Model

Gets an instance of the Model class.

Returns

Model

A new instance of the Model class initialized with the entity model of the current handle.

Inherited from

Entity.Model

Defined in

client/models/Entity.ts:106


NetworkId

get NetworkId(): number

Retrieves the network ID associated with the current entity.

Returns

number

The network ID of the entity.

Inherited from

Entity.NetworkId

Defined in

client/models/Entity.ts:43


NeverLeavesGroup

set NeverLeavesGroup(value): void

Parameters

value: boolean

Defined in

client/models/Ped.ts:453


Opacity

get Opacity(): number

Retrieves the opacity level of the entity associated with this handle.

set Opacity(value): void

Sets the opacity (alpha value) of this entity.

Parameters

value: number

The opacity value to set, where 0 is fully transparent and 255 is fully opaque.

Returns

number

The opacity level as a number, where 0 represents fully transparent and 255 represents fully opaque.

Inherited from

Entity.Opacity

Defined in

client/models/Entity.ts:397


Position

get Position(): Vector3

Gets the current position of the entity as a Vector3 object.

set Position(vector): void

Sets the position of the entity to the specified coordinates.

Parameters

vector: Vector3

The vector containing the new coordinates (x, y, z).

Returns

Vector3

The position of the entity in 3D space.

Inherited from

Entity.Position

Defined in

client/models/Entity.ts:115


Quaternion

get Quaternion(): Quaternion

Retrieves the quaternion for the current entity.

set Quaternion(quaternion): void

Sets the quaternion values for this entity.

Parameters

quaternion: Quaternion

The quaternion object containing x, y, z, and w components.

Returns

Quaternion

The quaternion representing the entity’s orientation.

Inherited from

Entity.Quaternion

Defined in

client/models/Entity.ts:152


Rotation

get Rotation(): Vector3

Retrieves the rotation of the entity as a Vector3.

set Rotation(vector): void

Sets the rotation of the entity.

Parameters

vector: Vector3

The vector representing the new rotation angles (in degrees) for the entity.

Returns

Vector3

The rotation of the

Inherited from

Entity.Rotation

Defined in

client/models/Entity.ts:133


RotationVelocity

get RotationVelocity(): Vector3

Retrieves the current rotation velocity of an entity. The rotation velocity is represented as a Vector3 object.

Returns

Vector3

The rotation velocity of the entity.

Inherited from

Entity.RotationVelocity

Defined in

client/models/Entity.ts:214


SpeechModifiersName

get SpeechModifiersName(): string[]

Returns

string[]

Defined in

client/models/Ped.ts:78


StaysInVehicleWhenJacked

set StaysInVehicleWhenJacked(value): void

Parameters

value: boolean

Defined in

client/models/Ped.ts:117


SubmersionLevel

get SubmersionLevel(): number

Retrieves the submersion level of the entity as a number.

Returns

number

The submersion level of the entity, where a higher value indicates a greater degree of submersion.

Inherited from

Entity.SubmersionLevel

Defined in

client/models/Entity.ts:251


VehicleTryingToEnter

get VehicleTryingToEnter(): Vehicle

Returns

Vehicle

Defined in

client/models/Ped.ts:108


Velocity

get Velocity(): Vector3

Computes and returns the velocity of the entity as a Vector3

set Velocity(velocity): void

Sets the velocity for the entity.

Parameters

velocity: Vector3

Returns

Vector3

Inherited from

Entity.Velocity

Defined in

client/models/Entity.ts:195

Methods

applyDamage()

applyDamage(damageAmount): void

Parameters

damageAmount: number

Returns

void

Defined in

client/models/Ped.ts:483


applyForce()

applyForce(direction, rotation, forceType?): void

Applies a force to the entity in a specified direction and with a specified rotation.

Parameters

direction: Vector3

The direction in which the force is to be applied.

rotation: Vector3

The rotational force to be applied.

forceType?: ForceType = ForceType.MaxForceRot2

The type of force to be applied, default is MaxForceRot2.

Returns

void

Inherited from

Entity.applyForce

Defined in

client/models/Entity.ts:807


applyForceRelative()

applyForceRelative(direction, rotation, forceType?): void

Applies a force to an entity in a direction relative to its current rotation.

Parameters

direction: Vector3

The direction vector in which the force is applied.

rotation: Vector3

The rotation vector representing the entity’s current rotation.

forceType?: ForceType = ForceType.MaxForceRot2

The type of force to be applied. Defaults to MaxForceRot2.

Returns

void

Inherited from

Entity.applyForceRelative

Defined in

client/models/Entity.ts:838


attachBlip()

attachBlip(): Blip

Attaches a blip to the entity associated with this instance.

Returns

Blip

The newly created Blip associated with the entity.

Inherited from

Entity.attachBlip

Defined in

client/models/Entity.ts:471


attachTo()

attachTo(entity, position, rotation): void

Attaches the current entity to a specified target entity at a given position and rotation.

Parameters

entity: Entity

The target entity to attach to.

position: Vector3

The position offset from the target entity.

rotation: Vector3

The rotation offset from the target entity.

Returns

void

Inherited from

Entity.attachTo

Defined in

client/models/Entity.ts:708


attachToBone()

attachToBone(entityBone, position, rotation): void

Attaches the current entity to a specified bone of another entity with given position and rotation offsets.

Parameters

entityBone: EntityBone

The bone of the target entity to attach this entity to.

position: Vector3

The position offset relative to the bone position.

rotation: Vector3

The rotation offset relative to the bone orientation.

Returns

void

Inherited from

Entity.attachToBone

Defined in

client/models/Entity.ts:737


cancelRagdoll()

cancelRagdoll(): void

Returns

void

Defined in

client/models/Ped.ts:597


clearBloodDamage()

clearBloodDamage(): void

Returns

void

Defined in

client/models/Ped.ts:445


clearLastWeaponDamage()

clearLastWeaponDamage(): void

Clears the last recorded weapon damage for the entity.

Returns

void

This method does not return a value.

Overrides

Entity.clearLastWeaponDamage

Defined in

client/models/Ped.ts:499


clone()

clone(networked): Ped

Parameters

networked: boolean

Returns

Ped

Defined in

client/models/Ped.ts:625


delete()

delete(): void

Deletes the current entity if it is not the player’s entity. The method first sets the entity as a mission entity and then deletes it.

Returns

void

No return value.

Inherited from

Entity.delete

Defined in

client/models/Entity.ts:885


detach()

detach(): void

Detaches the current entity from its parent, effectively making it independent.

This method calls DetachEntity with parameters to ensure the entity is completely detached, handling any necessary dependencies and housekeeping.

Returns

void

No return value.

Inherited from

Entity.detach

Defined in

client/models/Entity.ts:765


exists()

exists(): boolean

Checks if the entity exists in the current context.

Returns

boolean

True if the entity exists, otherwise false.

Inherited from

Entity.exists

Defined in

client/models/Entity.ts:875


getConfigFlag()

getConfigFlag(flagId): boolean

Parameters

flagId: number

Returns

boolean

Defined in

client/models/Ped.ts:613


getEntityAttachedTo()

getEntityAttachedTo(): Entity

Returns the entity to which this entity is attached.

Returns

Entity

The entity that this entity is attached to.

Inherited from

Entity.getEntityAttachedTo

Defined in

client/models/Entity.ts:794


getLastWeaponImpactPosition()

getLastWeaponImpactPosition(): Vector3

Experimental

Retrieves the last recorded impact position of a weapon. To Check after v0.9.0 update

Returns

Vector3

The position where the last weapon impact occurred.

Defined in

client/models/Ped.ts:554


getOffsetPosition()

getOffsetPosition(offset): Vector3

Calculates the world position offset from the entity’s current position.

Parameters

offset: Vector3

The local offset vector to be applied to the entity’s position.

Returns

Vector3

The new world position vector after applying the given offset.

Inherited from

Entity.getOffsetPosition

Defined in

client/models/Entity.ts:675


getPositionOffset()

getPositionOffset(worldCoords): Vector3

Calculates the position offset from the given world coordinates.

Parameters

worldCoords: Vector3

The world coordinates to calculate the offset from.

Returns

Vector3

Inherited from

Entity.getPositionOffset

Defined in

client/models/Entity.ts:688


giveHelmet()

giveHelmet(canBeRemoved, helmetType, textureIndex): void

Parameters

canBeRemoved: boolean

helmetType: HelmetType

textureIndex: number

Returns

void

Defined in

client/models/Ped.ts:601


giveWeapon()

giveWeapon(weapon, ammoCount?, isHidden?, equipNow?): void

Assigns a weapon to the character with specified properties.

Parameters

weapon: WeaponsHash

The type of weapon to give.

ammoCount?: number = 999

The amount of ammunition for the weapon.

isHidden?: boolean = false

Whether the weapon should be hidden.

equipNow?: boolean = true

Whether the weapon should be equipped immediately.

Returns

void

Defined in

client/models/Ped.ts:515


hasBeenDamagedBy()

hasBeenDamagedBy(entity): boolean

Determines if the current entity has been damaged by the specified entity.

Parameters

entity: Entity

The entity to check against for damage.

Returns

boolean

Inherited from

Entity.hasBeenDamagedBy

Defined in

client/models/Entity.ts:517


hasBeenDamagedByAnyMeleeWeapon()

hasBeenDamagedByAnyMeleeWeapon(): boolean

Checks if the entity has been damaged by any melee weapon.

This method determines whether the entity, represented by the ‘handle’, has sustained damage from any weapon falling under the melee category.

Returns

boolean

True if the entity has been damaged by any melee weapon; otherwise, false.

Overrides

Entity.hasBeenDamagedByAnyMeleeWeapon

Defined in

client/models/Ped.ts:495


hasBeenDamagedByAnyWeapon()

hasBeenDamagedByAnyWeapon(): boolean

Checks if the entity has been damaged by any weapon.

Returns

boolean

True if the entity has been damaged by any weapon; otherwise, false.

Overrides

Entity.hasBeenDamagedByAnyWeapon

Defined in

client/models/Ped.ts:491


hasBeenDamagedByWeapon()

hasBeenDamagedByWeapon(weapon): boolean

Checks if the entity has been damaged by the specified weapon.

Parameters

weapon: WeaponsHash

The weapon to check against.

Returns

boolean

Overrides

Entity.hasBeenDamagedByWeapon

Defined in

client/models/Ped.ts:487


hasClearLosToEntity()

hasClearLosToEntity(entity, traceType?): boolean

Checks if there is a clear line of sight to the specified entity.

Parameters

entity: Entity

The entity to check line of sight to.

traceType?: number = 17

The type of trace to use for the line of sight check.

Returns

boolean

Inherited from

Entity.hasClearLosToEntity

Defined in

client/models/Entity.ts:495


hasClearLosToEntityInFront()

hasClearLosToEntityInFront(entity): boolean

Determines if there is a clear line of sight (LOS) from the current entity to the specified entity in front.

Parameters

entity: Entity

The target entity to check LOS against.

Returns

boolean

Inherited from

Entity.hasClearLosToEntityInFront

Defined in

client/models/Entity.ts:506


isAttached()

isAttached(): boolean

Determines if the entity is currently attached.

Returns

boolean

True if the entity is attached, otherwise false.

Inherited from

Entity.isAttached

Defined in

client/models/Entity.ts:774


isAttachedTo()

isAttachedTo(entity): boolean

Checks whether the current entity is attached to the specified entity.

Parameters

entity: Entity

The entity to which the current entity might be attached.

Returns

boolean

True if the current entity is attached to the specified entity, false otherwise.

Inherited from

Entity.isAttachedTo

Defined in

client/models/Entity.ts:785


isHeadtracking()

isHeadtracking(entity): boolean

Parameters

entity: Entity

Returns

boolean

Defined in

client/models/Ped.ts:403


isInAngledArea()

isInAngledArea(origin, edge, angle): boolean

Determines if the entity is within an angled area specified by an origin point, an edge point, and an angle.

Parameters

origin: Vector3

The origin point of the angled area.

edge: Vector3

The edge point defining the angled area’s width.

angle: number

The angle of the area.

Returns

boolean

Inherited from

Entity.isInAngledArea

Defined in

client/models/Entity.ts:595


isInAnyVehicle()

isInAnyVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:383


isInArea()

isInArea(minBounds, maxBounds): boolean

Checks if the current entity is within the specified area defined by the minimum and maximum bounds.

Parameters

minBounds: Vector3

A Vector3 object representing the minimum bounds of the area.

maxBounds: Vector3

A Vector3 object representing the maximum bounds of the area.

Returns

boolean

Inherited from

Entity.isInArea

Defined in

client/models/Entity.ts:570


isInCombatAgainst()

isInCombatAgainst(target): boolean

Parameters

target: Ped

Returns

boolean

Defined in

client/models/Ped.ts:407


isInCover()

isInCover(expectUseWeapon): boolean

Parameters

expectUseWeapon: boolean = false

Returns

boolean

Defined in

client/models/Ped.ts:363


isInRangeOf()

isInRangeOf(position, range): boolean

Determines whether a given position is within a specified range of this object’s position.

Parameters

position: Vector3

The position to check against this object’s position.

range: number

The range within which to check.

Returns

boolean

Returns true if the given position is within the specified range, otherwise false.

Inherited from

Entity.isInRangeOf

Defined in

client/models/Entity.ts:619


isInVehicle()

isInVehicle(vehicle): boolean

Parameters

vehicle: Vehicle

Returns

boolean

Defined in

client/models/Ped.ts:387


isNearEntity()

isNearEntity(entity, bounds): boolean

Checks if the current entity is near the specified entity within the given bounds.

Parameters

entity: Entity

The entity to check proximity against.

bounds: Vector3

The 3D vector specifying the bounds to check within.

Returns

boolean

Inherited from

Entity.isNearEntity

Defined in

client/models/Entity.ts:633


isSittingInAnyVehicle()

isSittingInAnyVehicle(): boolean

Returns

boolean

Defined in

client/models/Ped.ts:391


isSittingInVehicle()

isSittingInVehicle(vehicle): boolean

Parameters

vehicle: Vehicle

Returns

boolean

Defined in

client/models/Ped.ts:395


isTouching()

isTouching(entity): boolean

Checks if the current entity is touching the specified entity.

Parameters

entity: Entity

The entity to check against.

Returns

boolean

True if the current entity is touching the specified entity, otherwise false.

Inherited from

Entity.isTouching

Defined in

client/models/Entity.ts:653


isTouchingModel()

isTouchingModel(model): boolean

Checks if the current entity is touching the specified model.

Parameters

model: Model

The model to check against.

Returns

boolean

Inherited from

Entity.isTouchingModel

Defined in

client/models/Entity.ts:664


kill()

kill(): void

Returns

void

Defined in

client/models/Ped.ts:427


leaveGroup()

leaveGroup(): void

Returns

void

Defined in

client/models/Ped.ts:457


markAsNoLongerNeeded()

markAsNoLongerNeeded(): void

Marks the entity as no longer needed by the game, which allows the game engine to clean it up as necessary. This method effectively turns off the mission flag for the entity and informs the system that it can regard this entity as disposable.

Returns

void

No return value.

Inherited from

Entity.markAsNoLongerNeeded

Defined in

client/models/Entity.ts:899


openParachute()

openParachute(): void

Returns

void

Defined in

client/models/Ped.ts:609


playAmbientSpeed()

playAmbientSpeed(speechName, voiceName, modifier): void

Parameters

speechName: string

voiceName: string = ''

modifier: SpeechModifier = SpeechModifier.Standard

Returns

void

Defined in

client/models/Ped.ts:461


ragdoll()

ragdoll(duration, ragdollType): void

Parameters

duration: number = -1

ragdollType: RagdollType = RagdollType.Normal

Returns

void

Defined in

client/models/Ped.ts:568


ragdollWithFall()

ragdollWithFall(duration, ragdollType, position): void

Parameters

duration: number = -1

ragdollType: RagdollType = RagdollType.Normal

position: Vector3 = ...

Returns

void

Defined in

client/models/Ped.ts:573


removeAllParticleEffects()

removeAllParticleEffects(): void

Removes all particle effects from the entity associated with this instance.

Returns

void

This method does not return a value.

Inherited from

Entity.removeAllParticleEffects

Defined in

client/models/Entity.ts:866


removeAllWeapons()

removeAllWeapons(): void

Removes all weapons from the current entity.

This method will strip the entity of all weapons it currently possesses.

Returns

void

Defined in

client/models/Ped.ts:542


removeHelmet()

removeHelmet(instantly): void

Parameters

instantly: boolean

Returns

void

Defined in

client/models/Ped.ts:605


removeWeapon()

removeWeapon(weapon): void

Removes the specified weapon from the current entity.

Parameters

weapon: WeaponsHash

The hash of the weapon to be removed.

Returns

void

Defined in

client/models/Ped.ts:531


resetConfigFlag()

resetConfigFlag(flagId): void

Parameters

flagId: number

Returns

void

Defined in

client/models/Ped.ts:621


resetOpacity()

resetOpacity(): void

Returns

void

Inherited from

Entity.resetOpacity

Defined in

client/models/Entity.ts:413


resetVisibleDamage()

resetVisibleDamage(): void

Returns

void

Defined in

client/models/Ped.ts:442


resurrect()

resurrect(): void

Returns

void

Defined in

client/models/Ped.ts:431


setConfigFlag()

setConfigFlag(flagId, value): void

Parameters

flagId: number

value: boolean

Returns

void

Defined in

client/models/Ped.ts:617


setIntoVehicle()

setIntoVehicle(vehicle, seat): void

Parameters

vehicle: Vehicle

seat: VehicleSeat

Returns

void

Defined in

client/models/Ped.ts:399


setNoCollision()

setNoCollision(entity, toggle): void

Sets the no-collision state between this entity and another entity.

Parameters

entity: Entity

The entity with which collision state will be set.

toggle: boolean

A boolean flag indicating whether to enable or disable the no-collision state.

Returns

void

Inherited from

Entity.setNoCollision

Defined in

client/models/Entity.ts:483


fromHandle()

static fromHandle(handle): Ped | Vehicle | Prop

Creates an instance of Ped, Vehicle, or Prop based on the given handle.

Parameters

handle: number

The handle of the entity.

Returns

Ped | Vehicle | Prop

Inherited from

Entity.fromHandle

Defined in

client/models/Entity.ts:910


fromNetworkId()

static fromNetworkId(networkId): Ped | Vehicle | Prop

Converts a network identifier to a corresponding entity (Ped, Vehicle, or Prop).

Parameters

networkId: number

The network identifier for the entity.

Returns

Ped | Vehicle | Prop

Inherited from

Entity.fromNetworkId

Defined in

client/models/Entity.ts:929