Skip to content

Ped

@vimp-mp/types 2.0.1

Interface · Client API

Client-created local ped or server-known ped. A remote ped may be known before/after stream-in.

ts
interface Ped

Members

alpha

ts
readonly alpha: number

Current opacity in the 0–255 range.

dimension

ts
readonly dimension: number

Client-side dimension value associated with this wrapper.

forwardVector

ts
readonly forwardVector: Vec3

Direction vector derived from the ped's current rotation.

handle

ts
readonly handle: number

GTA entity handle, or 0 while a remote ped is known but not streamed.

heading

ts
readonly heading: number

Cached or live heading in degrees.

id

ts
readonly id: number

Client-local 0-based wrapper id, unique per entity type and reused after destroy. Use remoteId for server/network state.

isAlive

ts
readonly isAlive: boolean

True while the remote ped exists in multiplayer state. Use handle !== 0 for local streamed visibility.

isRemote

ts
readonly isRemote: boolean

Whether this wrapper represents a server-owned ped.

model

ts
readonly model: number

GTA ped model hash.

position

ts
readonly position: Vec3

Cached or live world position, depending on streaming state.

remoteId

ts
readonly remoteId: number | null

Server ped id for remote peds; null for local-only peds. Zero is a valid remote id.

rotation

ts
readonly rotation: Vec3

Cached or live world rotation in degrees.

attachToEntity

ts
attachToEntity(target: { handle: number }, boneIndex: number, offset: Vec3, rotation: Vec3, p9: boolean, useSoftPinning: boolean, collision: boolean, isPed: boolean, vertexIndex: number, fixedRot: boolean): void

Attaches the native ped to another GTA entity.

clearDecorations

ts
clearDecorations(): void

Removes every decoration overlay from the ped.

clearProp

ts
clearProp(componentId: number): void

Clears the prop equipped in a component slot.

clearTasks

ts
clearTasks(): void

Clears the ped's queued GTA tasks.

destroy

ts
destroy(): boolean

Destroys this ped instance.

detach

ts
detach(useDetachVelocity: boolean, collision: boolean): void

Detaches the native ped from its current parent entity.

freezePosition

ts
freezePosition(freeze: boolean): void

Freezes or unfreezes the native ped when streamed.

getBoneCoords

ts
getBoneCoords(boneId: number, offsetX: number, offsetY: number, offsetZ: number): Vec3

Returns a ped bone's world coordinates with a local offset.

getBoneIndexByName

ts
getBoneIndexByName(boneName: string): number

Resolves a named bone on the native ped.

getComponentDrawable

ts
getComponentDrawable(componentId: number): number

Returns the active drawable for a clothing component.

getComponentTexture

ts
getComponentTexture(componentId: number): number

Returns the active texture for a clothing component.

getNumberOfDrawableVariations

ts
getNumberOfDrawableVariations(componentId: number): number

Returns the drawable count available for a clothing component.

getOffsetFromInWorldCoords

ts
getOffsetFromInWorldCoords(offsetX: number, offsetY: number, offsetZ: number): Vec3

Converts a ped-local offset into world coordinates.

getPropDrawable

ts
getPropDrawable(propId: number): number

Returns the active drawable for a prop slot.

getPropTexture

ts
getPropTexture(propId: number): number

Returns the active texture for a prop slot.

getSpeed

ts
getSpeed(): number

Returns the ped's current speed in metres per second.

getWorldPositionOfBone

ts
getWorldPositionOfBone(boneIndex: number): Vec3

Returns the world position of a bone on the native ped.

isPlayingAnim

ts
isPlayingAnim(dictionary: string, name: string, taskFlag: number): boolean

Reports whether the ped is playing the requested animation.

removeDecoration

ts
removeDecoration(collection: string | number, overlay: string | number): void

VIMP currently has no native for removing one decoration; this is a no-op.

resetAlpha

ts
resetAlpha(): void

Restores full opacity and updates the cached alpha to 255.

setAlpha

ts
setAlpha(alpha: number): void

Sets opacity, clamped to 0–255, and caches it across stream-in.

setBlockingOfNonTemporaryEvents

ts
setBlockingOfNonTemporaryEvents(blocking: boolean): void

Controls whether ambient events may interrupt the ped's scripted tasks.

setCollision

ts
setCollision(collision: boolean, keepPhysics: boolean): void

Enables or disables collision and caches the choice across stream-in.

setComponentVariation

ts
setComponentVariation(componentId: number, drawableId: number, textureId: number, paletteId: number): void

Changes a clothing component drawable, texture and palette.

setCoords

ts
setCoords(xPos: number, yPos: number, zPos: number, xAxis: boolean, yAxis: boolean, zAxis: boolean, clearArea: boolean): void

Moves the native ped using GTA's axis and area-clear flags.

setDecoration

ts
setDecoration(collection: string | number, overlay: string | number): void

Applies a tattoo or decoration overlay to the ped.

setDimension

ts
setDimension(dimension: number): void

Changes the client-side dimension value used for this wrapper.

setEyeColor

ts
setEyeColor(eyeColor: number): void

Changes the ped's eye-colour index.

setFaceFeature

ts
setFaceFeature(index: number, value: number): void

Sets one GTA face-feature morph value.

setHairColor

ts
setHairColor(colorId: number, highlightColorId: number): void

Changes the ped's base and highlight hair colours.

setHeadBlendData

ts
setHeadBlendData(shapeFirstId: number, shapeSecondId: number, shapeThirdId: number, skinFirstId: number, skinSecondId: number, skinThirdId: number, shapeMix: number, skinMix: number, thirdMix: number, isParent: boolean): void

Applies GTA freemode head-blend ancestry and mix values.

setHeading

ts
setHeading(heading: number): void

Updates the cached heading and the native ped when streamed.

setHeadOverlay

ts
setHeadOverlay(overlayId: number, index: number, opacity: number): void

Applies a head overlay and opacity to the ped.

setHeadOverlayColor

ts
setHeadOverlayColor(overlayId: number, colorTypeId: number, firstColor: number, secondColor: number): void

Applies palette colours to a ped head overlay.

setInvincible

ts
setInvincible(invincible: boolean): void

Enables or disables damage and caches the choice across stream-in.

setModel

ts
setModel(model: string | number): void

Replaces a local ped model or updates a remote ped's cached model.

setPosition

ts
setPosition(position: Vec3): void

Updates the cached position and moves the native ped when streamed.

setPropertyVariation

ts
setPropertyVariation(componentId: number, drawableId: number, textureId: number, attach: boolean): void

Changes an attached prop drawable and texture.

setRotation

ts
setRotation(rotation: Vec3): void

Updates the cached rotation and the native ped when streamed.

setVisible

ts
setVisible(visible: boolean): void

Shows or hides the ped and caches the choice across stream-in.

stopAnim

ts
stopAnim(dictionary: string, name: string, blendOutSpeed: number): void

Stops a specific animation task on the ped.

taskGoToCoordAnyMeans

ts
taskGoToCoordAnyMeans(x: number, y: number, z: number, speed: number, walkingStyle?: number, drivingFlags?: number): void

Tasks the ped to reach a world position using GTA pathfinding.

taskPlayAnim

ts
taskPlayAnim(dictionary: string, name: string, blendInSpeed: number, blendOutSpeed: number, duration: number, flag: number, playbackRate: number): void

Starts an animation task on the ped.

VIMP developer documentation