- Documentation
- Shared functions
- setPedAnimationProgress
Function
setPedAnimationProgress
Seeks a ped's current animation to a chosen point (0 = start, 1 = end). On the server it applies to the animation set by the server's setPedAnimation and reaches every player. On the client it applies to an IFP file animation playing on a ped in this game, and the animation name must match the current one.
Syntax
bool setPedAnimationProgress(ped ped, string anim, float progress)Arguments
pedped- A player or an NPC.
animstring- Name of the animation to seek (it must be the one playing).
progressfloat- Position from 0 (start) to 1 (end).
Returns
true on success, false when the ped is not playing that animation.
Example
setPedAnimation(ped, "ped", "WALK_civi", -1, true, false)
setPedAnimationProgress(ped, "WALK_civi", 0.5)
See also
setPedAnimationPlays an animation on a ped. The animation comes from a game animation block (e.g.ped,dancing,smoking) or from an IFP file loaded withengineLoadIFP. Calling it without a block stops the animation. On the server the animation reaches every player. On the client it only runs in this game: for the local player others see it through pose streaming; for a remote player the function returnsfalsebecause their appearance comes from their own game.setPedAnimationSpeedChanges the playback speed of a ped's current animation: 1 = normal, 0.5 = half speed, 0 = paused. On the server it applies to the animation from the server'ssetPedAnimation; on the client to an IFP file animation on a ped in this game.