- Documentation
- Shared functions
- setPedAnimationSpeed
Function
setPedAnimationSpeed
Changes 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's setPedAnimation; on the client to an IFP file animation on a ped in this game.
Syntax
bool setPedAnimationSpeed(ped ped, string anim, float speed)Arguments
pedped- A player or an NPC.
animstring- Name of the animation that is playing.Optional in MTA:SA: string anim = ""
speedfloat- Speed 0-1 (1 = normal).Optional in MTA:SA: float speed = 1.0
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
setPedAnimationSpeed(ped thePed, string anim = "", float speed = 1.0)Returns
true on success.
Example
setPedAnimation(ped, "dancing", "dnce_M_a")
setPedAnimationSpeed(ped, "dnce_M_a", 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.setPedAnimationProgressSeeks 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'ssetPedAnimationand 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.