getPedAnimation | Multi Theft Auto: Wiki Skip to content

getPedAnimation

Client-side
Server-side
Shared

Pair: setPedAnimation

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Gets the animation of a player or ped that was set using setPedAnimation.

Note

Use getPedTask to monitor what movements the player is currently doing.

Syntax

getPedAnimation ( )

Code Examples

client

This example adds a command that allows you to copy the animation being used by another player using /copyanim theirName

function CopyAnimation(theCommand, thePlayer) -- The Command Function
if thePlayer then -- If a player name entered then
thePlayerToCopyFrom = getPlayerFromName(thePlayer) -- get player from his name
block, anim = getPedAnimation(thePlayerToCopyFrom) -- get the player animation
if block then -- if got the animation successfully then
setPedAnimation(localPlayer, block, anim) -- set my animation the same
outputChatBox("* Copied Successfully !") -- output chat message
end
else
outputChatBox("* Please Enter a Player Name To Copy From !") -- if you didnt entered a player name , then output a chat box message
end
end
addCommandHandler("copyanim", CopyAnimation) -- adding the Command Handler

See Also