ApplyAnimation

From SA-MP Wiki

Jump to: navigation, search


Apply an animation to a player.


Parameters:
(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
playeridThe ID of the player to apply the animation to.
animlib[]The name of the animation library in which the animation to apply is in.
animname[]The name of the animation, within the library specified.
fDeltaThe speed to play the animation (use 4.1).
loopSet to 1 for looping otherwise set to 0 for playing animation sequence only once.
lockxSet to 0 to return player to original x position after animation is complete for moving animations. The opposite effect occurs if set to 1.
lockySet to 0 to return player to original y position after animation is complete for moving animations. The opposite effect occurs if set to 1.
freezeWill freeze the player in position after the animation finishes.
timeTimer in milliseconds. For a never ending loop it should be 0.
forcesyncSet to 1 to force playerid to sync animation with other players in all instances (optional).


ReturnsThis function doesn't return a specific value


ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);


Image:32px-Ambox_warning_orange.png Note: The 'forcesync' optional parameter, which defaults to 0, in most cases is not needed since players sync animations themselves. The 'forcesync' parameter can force all players who can see 'playerid' to play the animation regardless of whether the player is performing that animation. This is useful in circumstances where the player can't sync the animation themselves. For example, they may be paused.


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
In other languages