Ped
@vimp-mp/types 2.0.1Server-spawned NPC (pedestrian). Returned from vimp.peds.create.
All readable properties are pass-through to the native ops; mutating world, health, visibility, physics or weapon properties broadcasts a SetPed* message to every player currently streaming the ped, so the change is visible in-game without re-creating the entity.
Use teleport(x, y, z, heading?) to update position and heading in a single broadcast — analogous to Player.teleport.
interface Ped extends StreamSyncedMetaMembers
accuracy
accuracy: numberPed accuracy, clamped by runtime to 0-100. Default: 0.
alpha
alpha: numberEntity alpha, clamped by runtime to 0-255. Default: 255.
armour
armour: numberCurrent ped armour.
collision
collision: booleanToggle client-side collision. Default: true.
dimension
dimension: numberVirtual world; the ped is visible only to players in the same dimension.
frozen
frozen: booleanFreeze/unfreeze the streamed native ped. Default: false.
heading
heading: numberAuthoritative heading in degrees.
health
health: numberCurrent ped health.
id
readonly id: numberServer-assigned ped identifier.
invincible
invincible: booleanToggle client-side invincibility. Default: false.
isExists
readonly isExists: booleanWhether the ped is still registered with the server runtime.
maxHealth
maxHealth: numberMaximum health, clamped by runtime to 1-10000.
model
model: numberGTA ped model hash replicated to streaming clients.
position
position: Vec3Authoritative world position replicated to streaming clients.
rotation
rotation: Vec3Rotation represented as { x: 0, y: 0, z: heading }.
visible
visible: booleanClient-side visibility for streamed ped instances. Default: true.
weapon
weapon: Weapon | nullSingle authoritative equipped weapon, or null when unarmed.
deleteStreamSyncedMeta
deleteStreamSyncedMeta(key: string): voidDeletes key and propagates the removal to streaming clients.
destroy
destroy(): booleanDestroys this ped instance.
getStreamSyncedMeta
getStreamSyncedMeta<T = unknown>(key: string): T | undefinedReturns undefined if the key is unset.
getStreamSyncedMetaKeys
getStreamSyncedMetaKeys(): Array<string>Returns all stream-synced metadata keys stored on the entity.
giveWeapon
giveWeapon(hash: number, ammo?: number): booleanEquip one authoritative weapon. Defaults ammo to 30.
hasStreamSyncedMeta
hasStreamSyncedMeta(key: string): booleanReturns whether the entity has a value for key.
removeWeapon
removeWeapon(): booleanRemove the authoritative ped weapon.
setRotation
setRotation(rotation: Vec3): voidSet rotation; only z is authoritative for VIMP peds.
setStreamSyncedMeta
setStreamSyncedMeta(key: string, value: unknown): voidSet or replace one key. The value is forwarded to every player currently streaming this entity, plus included in the snapshot for any future stream-in. Use deleteStreamSyncedMeta rather than undefined when the key must be removed.
teleport
teleport(x: number, y: number, z: number, heading?: number): booleanMoves the ped and optionally changes its heading in one replicated update.