Player
@vimp-mp/types 2.0.1Player known to this client. Local players and streamed remote players expose a live GTA ped handle; non-streamed remotes keep handle = 0 and mutation methods degrade to no-ops until they stream in.
Stream-synced meta methods are class-level shortcuts that bind type = Player and this.id implicitly — they're equivalent to vimp.entities.getStreamSyncedMeta(ENTITY_TYPE.Player, this.id, key).
interface PlayerMembers
alpha
readonly alpha: numberCurrent entity opacity.
forwardVector
readonly forwardVector: Vec3Current forward direction vector.
handle
readonly handle: numberGTA ped/entity handle, or 0 when a remote player is not streamed.
heading
readonly heading: numberCurrent heading in degrees.
id
readonly id: numberServer/network player identifier.
isLocal
readonly isLocal: booleanWhether this wrapper represents the local player.
isStreamed
readonly isStreamed: booleanWhether the player's GTA ped is currently streamed.
isTalking
readonly isTalking: booleanWhether the player is currently transmitting voice audio.
model
readonly model: numberCurrent ped model hash.
name
readonly name: stringCurrent display name.
position
readonly position: Vec3Current world position.
rotation
readonly rotation: Vec3Current world rotation in degrees.
socialClub
readonly socialClub: stringSocial Club account name reported for the player.
vehicle
readonly vehicle: Vehicle | nullVehicle the player is currently sitting in, or null when the player is on foot, still playing the entry animation, not streamed, or sitting in a vehicle VIMP does not track.
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 player ped to another GTA entity.
clearDecorations
clearDecorations(): voidRemoves all decorations from the player ped.
clearProp
clearProp(componentId: number): voidClears the prop equipped in the specified component slot.
clearTasks
clearTasks(): voidClears queued tasks on the player ped.
clearTasksImmediately
clearTasksImmediately(): voidImmediately clears all tasks on the player ped.
detach
detach(useDetachVelocity: boolean, collision: boolean): voidDetaches the player ped from its current parent entity.
freezePosition
freezePosition(freeze: boolean): voidFreezes or unfreezes the player's current position.
getBoneCoords
getBoneCoords(boneId: number, offsetX: number, offsetY: number, offsetZ: number): Vec3Returns a ped bone's world coordinates with an optional local offset.
getBoneIndex
getBoneIndex(boneId: number): numberResolves a GTA ped bone ID to its runtime bone index.
getBoneIndexByName
getBoneIndexByName(boneName: string): numberResolves a named bone on the streamed player ped, or returns -1.
getComponentDrawable
getComponentDrawable(componentId: number): numberReturns the active drawable for a clothing component.
getComponentTexture
getComponentTexture(componentId: number): numberReturns the active texture for a clothing component.
getOffsetFromInWorldCoords
getOffsetFromInWorldCoords(offsetX: number, offsetY: number, offsetZ: number): Vec3Converts a player-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 streamed player ped's current speed in metres per second.
getStreamSyncedMeta
getStreamSyncedMeta<T = unknown>(key: string): T | undefinedReads a stream-synced value, or undefined when the key is unavailable.
getStreamSyncedMetaKeys
getStreamSyncedMetaKeys(): Array<string>Lists the stream-synced keys currently cached for this player.
getWorldPositionOfBone
getWorldPositionOfBone(boneIndex: number): Vec3Returns the world position of a bone on the streamed player ped.
hasStreamSyncedMeta
hasStreamSyncedMeta(key: string): booleanReports whether the player currently exposes a stream-synced key.
isPlayingAnim
isPlayingAnim(dictionary: string, name: string, taskFlag: number): booleanReports whether the streamed player ped is playing an 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 the player's default opacity.
setAlpha
setAlpha(alpha: number): voidChanges the streamed player ped's opacity.
setCollision
setCollision(collision: boolean, keepPhysics: boolean): voidEnables or disables collision for the streamed player ped.
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 streamed player 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 player ped.
setEyeColor
setEyeColor(eyeColor: number): voidChanges the player 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 player 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): voidChanges the streamed player ped's heading in degrees.
setHeadOverlay
setHeadOverlay(overlayId: number, index: number, opacity: number): voidApplies a head overlay and opacity to the player ped.
setHeadOverlayColor
setHeadOverlayColor(overlayId: number, colorTypeId: number, firstColor: number, secondColor: number): voidApplies palette colours to a player head overlay.
setInvincible
setInvincible(invincible: boolean): voidEnables or disables damage for the streamed player ped.
setModel
setModel(model: string | number): voidReplaces the player's streamed ped model using a hash or model name.
setNoCollision
setNoCollision(otherHandle: number, thisFrameOnly: boolean): voidSuppresses collision with another GTA entity for this frame or persistently.
setPosition
setPosition(position: Vec3): voidMoves the streamed player ped to a world position without an offset.
setPropertyVariation
setPropertyVariation(componentId: number, drawableId: number, textureId: number, attach: boolean): voidChanges an attached prop drawable and texture.
setRotation
setRotation(rotation: Vec3): voidChanges the streamed player ped's rotation in degrees.
setVisible
setVisible(visible: boolean): voidShows or hides the streamed player ped.
stopAnim
stopAnim(dictionary: string, name: string, blendOutSpeed: number): voidStops the specified animation on the player ped.
taskEnterVehicle
taskEnterVehicle(vehicleHandle: number, timeout: number, seat: number, speed: number, flag: number, overrideEntryClipsetName?: string): voidInstructs the player ped to enter a GTA vehicle.
taskPlayAnim
taskPlayAnim(dictionary: string, name: string, blendInSpeed: number, blendOutSpeed: number, duration: number, flag: number, playbackRate: number, lockX?: boolean, lockY?: boolean, lockZ?: boolean): voidStarts an animation task on the player ped.
taskSwapWeapon
taskSwapWeapon(drawWeapon?: boolean): voidInstructs the player ped to draw or holster its weapon.