ClearAnimations

From SA-MP Wiki

Jump to: navigation, search


Description:

Clears all animations for the given player (it also cancels all current tasks such as jetpacking,parachuting,entering vehicles, driving (removes player out of vehicle), swimming, etc.. ).


Parameters:
(playerid, forcesync = 0)
playeridThe ID of the player to clear the animations of.
forcesyncSet to 1 to force playerid to sync the animation with other players in streaming radius (optional)


Return Values:

This function always returns 1, even when the player specified is not connected.


Image:32px-Ambox_warning_orange.png

Note

ClearAnimations doesn't do anything when the animation ends if we pass 1 for the freeze parameter in ApplyAnimation.


Tip

Image:Light_bulb_icon.png

Unlike some other ways to remove player from a vehicle, this will also reset the vehicle's velocity to zero, instantly stopping the car. Player will appear on top of the vehicle with the same location as he was in his car seat.


Example Usage:

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/animclear", true))
    {
        ClearAnimations(playerid);
        return 1;
    }
    return 0;
}

Related Functions

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

Personal tools
Navigation
Toolbox
In other languages