players.playAnimation
Plays an animation on a player, seen by everyone near them.
Signature
Section titled “Signature”players.playAnimation(player: PlayerTarget, animationGroup: string, animationName: string, loop?: boolean): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerTarget |
The player, or their ID. |
animationGroup |
string |
GTA:SA’s animation group, up to 24 characters; all of them on Animations. |
animationName |
string |
The animation in that group, up to 32 characters. |
loop |
boolean |
Optional. true repeats it until stopAnimation; the default false plays it once. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the player’s game has carried it out, rejected with a code, or timeout after five seconds without an answer.
Example
Section titled “Example”import { commands, players } from "nativemp";
commands.register("walk", async (player) => { await players.playAnimation(player, "player", "walk_player", true);});Related
Section titled “Related”players.stopAnimation: end it- Animations: every group and animation
A captured Player keeps this effect bound to its connection across awaits; see Async handlers.