RedM Natives

TASK_PLAY_ANIM_ADVANCED

Similar in functionality to TASK_PLAY_ANIM, except the position and rotation parameters let you specify the initial position and rotation of the task.

Hash0x3DDEB0E6
Runtime nameTaskPlayAnimAdvanced
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void TASK_PLAY_ANIM_ADVANCED(Ped ped, char* animDictionary, char* animationName, float posX, float posY, float posZ, float rotX, float rotY, float rotZ, float blendInSpeed, float blendOutSpeed, int duration, Any flag, float animTime, Any p14, Any p15);

Parameters

NameTypeDescription
pedPed

The ped you want to play the animation

animDictionarychar*

The animation dictionary

animationNamechar*

The animation name

posXfloat

Initial X position of the task

posYfloat

Initial Y position of the task

posZfloat

Initial Z position of the task

rotXfloat

Initial X rotation of the task

rotYfloat

Initial Y rotation of the task

rotZfloat

Initial Z rotation of the task

blendInSpeedfloat

The speed at which the animation blends in. Lower is slower and higher is faster, 1.0 is normal, 8.0 is basically instant

blendOutSpeedfloat

The speed at which the animation blends out. Lower is slower and higher is faster, 1.0 is normal, 8.0 is basically instant

durationint

The duration of the animation in milliseconds. -1 will play the animation until canceled

flagAny

See TASK_PLAY_ANIM

animTimefloat

Value between 0.0 and 1.0, lets you start an animation from the given point

p14Any—
p15Any—

Returns void

Description

Cfx.re native reference

Similar in functionality to TASK_PLAY_ANIM, except the position and rotation parameters let you specify the initial position and rotation of the task. The ped is teleported to the position specified. Animations list

This is the server-side RPC native equivalent of the client native TASK_PLAY_ANIM_ADVANCED.

Usage

Lua
TaskPlayAnimAdvanced(ped, animDictionary, animationName, posX, posY, posZ, rotX, rotY, rotZ, blendInSpeed, blendOutSpeed, duration, flag, animTime, p14, p15)

-- always works, by hash
Citizen.InvokeNative(0x3ddeb0e6, ped, animDictionary, animationName, posX, posY, posZ, rotX, rotY, rotZ, blendInSpeed, blendOutSpeed, duration, flag, animTime, p14, p15)
JavaScript and C#
JavaScript
TaskPlayAnimAdvanced(ped, animDictionary, animationName, posX, posY, posZ, rotX, rotY, rotZ, blendInSpeed, blendOutSpeed, duration, flag, animTime, p14, p15);

// by hash
Citizen.invokeNative('0x3ddeb0e6', ped, animDictionary, animationName, posX + 0.0000001, posY + 0.0000001, posZ + 0.0000001, rotX + 0.0000001, rotY + 0.0000001, rotZ + 0.0000001, blendInSpeed + 0.0000001, blendOutSpeed + 0.0000001, duration, flag, animTime + 0.0000001, p14, p15);
C#
Function.Call((Hash)0x3ddeb0e6, ped, animDictionary, animationName, posX, posY, posZ, rotX, rotY, rotZ, blendInSpeed, blendOutSpeed, duration, flag, animTime, p14, p15);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.