M MY Multiplayer: Wiki
Side
Kind

getPedAnimationProgress

Client

Tells how far along the animation the ped is playing is, such as one from setPedAnimation.

float getPedAnimationProgress(ped ped)

Parameters

NameTypeDescription
pedpedThe ped or player.

Returns

A number from 0 (start) to 1 (end), or -1 if the ped plays no named animation or is streamed out.

Example

addEventHandler("onClientRender", root, function()
    local progress = getPedAnimationProgress(localPlayer)
    if progress >= 0 then
        dxDrawText(("%d%%"):format(progress * 100), 20, 300)
    end
end)

See also