TasksClient

taskPlayAnim

TASK_PLAY_ANIM0xEA47FE3719165B94

The GTA V native TASK_PLAY_ANIM of the TASK namespace, as LS:MP client scripts call it: the global function taskPlayAnim, in JavaScript and in Lua.

SignatureJavaScript
taskPlayAnim(
  ped: Ped,
  animDictionary: string,
  animationName: string,
  blendInSpeed: number,
  blendOutSpeed: number,
  duration: number,
  flag: number,
  playbackRate: number,
  lockX: boolean,
  lockY: boolean,
  lockZ: boolean
): void
SignatureLua
taskPlayAnim(
  ped: Ped,
  animDictionary: string,
  animationName: string,
  blendInSpeed: number,
  blendOutSpeed: number,
  duration: integer,
  flag: integer,
  playbackRate: number,
  lockX: boolean,
  lockY: boolean,
  lockZ: boolean
)

Usage

JavaScript
taskPlayAnim(
  ped, animDictionary, animationName, blendInSpeed, blendOutSpeed, duration, flag, playbackRate,
  lockX, lockY, lockZ
);
Lua
taskPlayAnim(
    ped, animDictionary, animationName, blendInSpeed, blendOutSpeed, duration, flag,
    playbackRate, lockX, lockY, lockZ
)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
animDictionarystringstringstring
animationNamestringstringstring
blendInSpeedfloatnumbernumber
blendOutSpeedfloatnumbernumber
durationintnumberinteger
flagintnumberinteger
playbackRatefloatnumbernumber
lockXBOOLbooleanboolean
lockYBOOLbooleanboolean
lockZBOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Full list of animation dictionaries and anims by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/animDictsCompact.json

float speed > normal speed is 8.0f


float speedMultiplier > multiply the playback speed


int duration: time in millisecond


-1 _ _ _ _ _ _ _> Default (see flag)
0 _ _ _ _ _ _ _ > Not play at all
Small value _ _ > Slow down animation speed
Other _ _ _ _ _ > freeze player control until specific time (ms) has
_ _ _ _ _ _ _ _ _ passed. (No effect if flag is set to be
_ _ _ _ _ _ _ _ _ controllable.)

01 to 15 > Full body
10 to 31 > Upper body
32 to 47 > Full body > Controllable
48 to 63 > Upper body > Controllable
...
001 to 255 > Normal
256 to 511 > Garbled
...

playbackRate:

values are between 0.0 and 1.0

lockX:

0 in most cases 1 for rcmepsilonism8 and rcmpaparazzo_3
> 1 for mini@sprunk

lockY:

0 in most cases
1 for missfam5_yoga, missfra1mcs_2_crew_react

lockZ:

0 for single player
Can be 1 but only for MP

Reference

Namespace
Tasks TASK
In the game
void TASK_PLAY_ANIM(Ped ped, const char* animDictionary, const char* animationName, float blendInSpeed, float blendOutSpeed, int duration, int flag, float playbackRate, BOOL lockX, BOOL lockY, BOOL lockZ)
Hash
0xEA47FE3719165B94

Open in the interactive natives reference