GetPedAnimationSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added new function (TODO: Example required!))
 
 
(3 intermediate revisions by 2 users not shown)
Line 16: Line 16:
===Returns===
===Returns===
Returns animation speed on success, -1 otherwise.
Returns animation speed on success, -1 otherwise.
===Examples===
<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