GetPedAnimationSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 18: Line 18:


===Examples===
===Examples===
{{Needs Example}}
<syntaxhighlight lang="lua">
addCommandHandler("getanimspeed",
    function()
        local animSpeed = getPedAnimationSpeed(localPlayer)
 
        if animSpeed ~= -1 then
            outputChatBox("Your current animation speed is: " .. tostring(animSpeed))
        else
            outputChatBox("Could not retrieve your animation speed.")
        end
    end
)
</syntaxhighlight>


==See Also==
==See Also==
{{Client_ped_functions}}
{{Client_ped_functions}}

Latest revision as of 17:15, 22 August 2025

ADDED/UPDATED IN VERSION 1.6.0 r22780:

This function returns the speed of a current running ped animation.

Syntax

float getPedAnimationSpeed ( ped thePed )

Required Arguments

Returns

Returns animation speed on success, -1 otherwise.

Examples

addCommandHandler("getanimspeed",
    function()
        local animSpeed = getPedAnimationSpeed(localPlayer)

        if animSpeed ~= -1 then
            outputChatBox("Your current animation speed is: " .. tostring(animSpeed))
        else
            outputChatBox("Could not retrieve your animation speed.")
        end
    end
)

See Also