From SA-MP Wiki
Apply an animation to a player.
(playerid, animlib, animname, Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
|playerid||The 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.|
|fDelta||The speed to play the animation (use 4.1).|
|loop||Set to 1 for looping otherwise set to 0 for playing animation sequence only once.|
|lockx||Set to 0 to return player to original x position after animation is complete for moving animations. The opposite effect occurs if set to 1.|
|locky||Set to 0 to return player to original y position after animation is complete for moving animations. The opposite effect occurs if set to 1.|
|freeze||Will freeze the player in position after the animation finishes.|
|time||Timer in milliseconds. For a never ending loop it should be 0.|
|forcesync||Set to 1 to force playerid to sync animation with other players in all instances (optional).|
|Returns||This function doesn't return a specific value|
||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.
The following functions may be useful, as they are related to this function in one way or another.