Skip to content

TaskPlayAnim

Is equal to the standard one but dont need to load or request the anim dict

Argument Data Type Needed Default Description
Ped ped - The ped
Animation dictionary string - The animation dictionary, this is the list
Animation name string - The animation name, this is the list
Blend in speed number - The blend in speed
Blend out speed number - The blend out speed
Duration number - The duration time in milliseconds (ms)
Flag number - The animation flag: -1 loop, 51 moving, 0/50 stuck
Playback Rate number - No description, values are between 0.0 and 1.0
LockX boolean 0 No description, 0 in most cases
LockY boolean 0 No description, 0 in most cases
LockZ boolean 0 No description, 0 in most cases

Dont need to be called every frame


Example
TaskPlayAnim(PlayerPedId(), "amb@world_human_golf_player@male@idle_a", "idle_a", 8.0, 1.0, -1, 49, 0)
Old method
if not HasAnimDictLoaded("amb@world_human_golf_player@male@idle_a") then
    RequestAnimDict("amb@world_human_golf_player@male@idle_a")
    while not HasAnimDictLoaded("amb@world_human_golf_player@male@idle_a") do 
        Citizen.Wait(1) 
    end
end

TaskPlayAnim(PlayerPedId(), "amb@world_human_golf_player@male@idle_a", "idle_a", 8.0, 1.0, -1, 49, 0)
RemoveAnimDict("amb@world_human_golf_player@male@idle_a")
Using old native

although i dont recommend it, you can use the old native via old_TaskPlayAnim


Last update: April 12, 2022
Created: June 27, 2021