Ped
@vimp-mp/types 2.0.1Client-created local ped or server-known ped. A remote ped may be known before/after stream-in.
interface PedMembers
alpha
readonly alpha: numberCurrent opacity in the 0–255 range.
dimension
readonly dimension: numberClient-side dimension value associated with this wrapper.
forwardVector
readonly forwardVector: Vec3Direction vector derived from the ped's current rotation.
handle
readonly handle: numberGTA entity handle, or 0 while a remote ped is known but not streamed.
heading
readonly heading: numberCached or live heading in degrees.
id
readonly id: numberClient-local 0-based wrapper id, unique per entity type and reused after destroy. Use remoteId for server/network state.
isAlive
readonly isAlive: booleanTrue while the remote ped exists in multiplayer state. Use handle !== 0 for local streamed visibility.
isRemote
readonly isRemote: booleanWhether this wrapper represents a server-owned ped.
model
readonly model: numberGTA ped model hash.
position
readonly position: Vec3Cached or live world position, depending on streaming state.
remoteId
readonly remoteId: number | nullServer ped id for remote peds; null for local-only peds. Zero is a valid remote id.
rotation
readonly rotation: Vec3Cached or live world rotation in degrees.
attachToEntity
attachToEntity(target: { handle: number }, boneIndex: number, offset: Vec3, rotation: Vec3, p9: boolean, useSoftPinning: boolean, collision: boolean, isPed: boolean, vertexIndex: number, fixedRot: boolean): voidAttaches the native ped to another GTA entity.
clearDecorations
clearDecorations(): voidRemoves every decoration overlay from the ped.
clearProp
clearProp(componentId: number): voidClears the prop equipped in a component slot.
clearTasks
clearTasks(): voidClears the ped's queued GTA tasks.
destroy
destroy(): booleanDestroys this ped instance.
detach
detach(useDetachVelocity: boolean, collision: boolean): voidDetaches the native ped from its current parent entity.
freezePosition
freezePosition(freeze: boolean): voidFreezes or unfreezes the native ped when streamed.
getBoneCoords
getBoneCoords(boneId: number, offsetX: number, offsetY: number, offsetZ: number): Vec3Returns a ped bone's world coordinates with a local offset.
getBoneIndexByName
getBoneIndexByName(boneName: string): numberResolves a named bone on the native ped.
getComponentDrawable
getComponentDrawable(componentId: number): numberReturns the active drawable for a clothing component.
getComponentTexture
getComponentTexture(componentId: number): numberReturns the active texture for a clothing component.
getNumberOfDrawableVariations
getNumberOfDrawableVariations(componentId: number): numberReturns the drawable count available for a clothing component.
getOffsetFromInWorldCoords
getOffsetFromInWorldCoords(offsetX: number, offsetY: number, offsetZ: number): Vec3Converts a ped-local offset into world coordinates.
getPropDrawable
getPropDrawable(propId: number): numberReturns the active drawable for a prop slot.
getPropTexture
getPropTexture(propId: number): numberReturns the active texture for a prop slot.
getSpeed
getSpeed(): numberReturns the ped's current speed in metres per second.
getWorldPositionOfBone
getWorldPositionOfBone(boneIndex: number): Vec3Returns the world position of a bone on the native ped.
isPlayingAnim
isPlayingAnim(dictionary: string, name: string, taskFlag: number): booleanReports whether the ped is playing the requested animation.
removeDecoration
removeDecoration(collection: string | number, overlay: string | number): voidVIMP currently has no native for removing one decoration; this is a no-op.
resetAlpha
resetAlpha(): voidRestores full opacity and updates the cached alpha to 255.
setAlpha
setAlpha(alpha: number): voidSets opacity, clamped to 0–255, and caches it across stream-in.
setBlockingOfNonTemporaryEvents
setBlockingOfNonTemporaryEvents(blocking: boolean): voidControls whether ambient events may interrupt the ped's scripted tasks.
setCollision
setCollision(collision: boolean, keepPhysics: boolean): voidEnables or disables collision and caches the choice across stream-in.
setComponentVariation
setComponentVariation(componentId: number, drawableId: number, textureId: number, paletteId: number): voidChanges a clothing component drawable, texture and palette.
setCoords
setCoords(xPos: number, yPos: number, zPos: number, xAxis: boolean, yAxis: boolean, zAxis: boolean, clearArea: boolean): voidMoves the native ped using GTA's axis and area-clear flags.
setDecoration
setDecoration(collection: string | number, overlay: string | number): voidApplies a tattoo or decoration overlay to the ped.
setDimension
setDimension(dimension: number): voidChanges the client-side dimension value used for this wrapper.
setEyeColor
setEyeColor(eyeColor: number): voidChanges the ped's eye-colour index.
setFaceFeature
setFaceFeature(index: number, value: number): voidSets one GTA face-feature morph value.
setHairColor
setHairColor(colorId: number, highlightColorId: number): voidChanges the ped's base and highlight hair colours.
setHeadBlendData
setHeadBlendData(shapeFirstId: number, shapeSecondId: number, shapeThirdId: number, skinFirstId: number, skinSecondId: number, skinThirdId: number, shapeMix: number, skinMix: number, thirdMix: number, isParent: boolean): voidApplies GTA freemode head-blend ancestry and mix values.
setHeading
setHeading(heading: number): voidUpdates the cached heading and the native ped when streamed.
setHeadOverlay
setHeadOverlay(overlayId: number, index: number, opacity: number): voidApplies a head overlay and opacity to the ped.
setHeadOverlayColor
setHeadOverlayColor(overlayId: number, colorTypeId: number, firstColor: number, secondColor: number): voidApplies palette colours to a ped head overlay.
setInvincible
setInvincible(invincible: boolean): voidEnables or disables damage and caches the choice across stream-in.
setModel
setModel(model: string | number): voidReplaces a local ped model or updates a remote ped's cached model.
setPosition
setPosition(position: Vec3): voidUpdates the cached position and moves the native ped when streamed.
setPropertyVariation
setPropertyVariation(componentId: number, drawableId: number, textureId: number, attach: boolean): voidChanges an attached prop drawable and texture.
setRotation
setRotation(rotation: Vec3): voidUpdates the cached rotation and the native ped when streamed.
setVisible
setVisible(visible: boolean): voidShows or hides the ped and caches the choice across stream-in.
stopAnim
stopAnim(dictionary: string, name: string, blendOutSpeed: number): voidStops a specific animation task on the ped.
taskGoToCoordAnyMeans
taskGoToCoordAnyMeans(x: number, y: number, z: number, speed: number, walkingStyle?: number, drivingFlags?: number): voidTasks the ped to reach a world position using GTA pathfinding.
taskPlayAnim
taskPlayAnim(dictionary: string, name: string, blendInSpeed: number, blendOutSpeed: number, duration: number, flag: number, playbackRate: number): voidStarts an animation task on the ped.