# CFX::TASK_PLAY_ANIM_ADVANCED

- **Hash:** `0x3DDEB0E6`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `TaskPlayAnimAdvanced`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/TASK_PLAY_ANIM_ADVANCED

## Signature

```c
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

- `ped` (`Ped`) — The ped you want to play the animation
- `animDictionary` (`char*`) — The animation dictionary
- `animationName` (`char*`) — The animation name
- `posX` (`float`) — Initial X position of the task
- `posY` (`float`) — Initial Y position of the task
- `posZ` (`float`) — Initial Z position of the task
- `rotX` (`float`) — Initial X rotation of the task
- `rotY` (`float`) — Initial Y rotation of the task
- `rotZ` (`float`) — Initial Z rotation of the task
- `blendInSpeed` (`float`) — The speed at which the animation blends in. Lower is slower and higher is faster, 1.0 is normal, 8.0 is basically instant
- `blendOutSpeed` (`float`) — The speed at which the animation blends out. Lower is slower and higher is faster, 1.0 is normal, 8.0 is basically instant
- `duration` (`int`) — The duration of the animation in milliseconds. -1 will play the animation until canceled
- `flag` (`Any`) — See [`TASK_PLAY_ANIM`](#\_0xEA47FE3719165B94)
- `animTime` (`float`) — Value between 0.0 and 1.0, lets you start an animation from the given point
- `p14` (`Any`)
- `p15` (`Any`)

## Returns

`void`

## Description

*Source: Cfx.re native reference*

Similar in functionality to [`TASK_PLAY_ANIM`](#\_0xEA47FE3719165B94), 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](https://alexguirre.github.io/animations-list/)

**This is the server-side RPC native equivalent of the client native [TASK_PLAY_ANIM_ADVANCED](?\_0x83CDB10EA29B370B).**

## Usage

### Lua

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

-- always available, by hash
Citizen.InvokeNative(0x3ddeb0e6, ped, animDictionary, animationName, posX, posY, posZ, rotX, rotY, rotZ, blendInSpeed, blendOutSpeed, duration, flag, animTime, p14, p15)
```

### JavaScript

```js
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#

```csharp
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.*
