GetPedAnimationData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
{{Client function}}
{{Client function}}


Gets the animation data of a player or ped that was set using [[setPedAnimation]] or [[blendPedAnimation]].
This function is used to return the animation data of a [[player]] or [[ped]] that was set using [[setPedAnimation]] or [[blendPedAnimation]].


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
table getPedAnimationData ( ped thePed, string dataType )
table getPedAnimationData ( ped thePed )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''thePed:''' the player or ped you want to get the animation data of.
*'''thePed:''' the player or ped you want to get the animation data of.
*'''dataType:''' A string representing the type of data you want to retrieve:
==Data-types==
*'''name:''' string - name of animation.
*'''blockName:''' string - name of animation block.
*'''loop:''' boolean - looping.
*'''updatePosition:''' boolean - updating position.
*'''interruptable:''' boolean - interruptable.
*'''time:''' float - duration.
*'''startTime:''' float - starting point.
*'''finished:''' boolean - finished playing.
*'''speed:''' float - speed.
*'''blendSpeed:''' float - blending speed.


===Returns===
===Returns===
Returns various arguments depending on the 'dataType' specified.
Returns a [[table]] containing information about animation. These keys are present in the table:
 
*'''name:''' string - name of the animation
==Example==
*'''block_name:''' string - name of animation block
*'''loop:''' boolean - is animation looping?
*'''update_position:''' boolean - updating position
*'''interruptible:''' boolean - is animation interruptible?
*'''time:''' float - duration of the animation
*'''start_time:''' float - starting point
*'''finished:''' boolean - has animation finished playing?
*'''speed:''' float - speed
*'''blend_speed:''' float - blending speed


==See Also==
==See Also==
{{Ped_functions}}
{{Client ped functions}}

Revision as of 12:46, 13 June 2009

This function is used to return the animation data of a player or ped that was set using setPedAnimation or blendPedAnimation.

Syntax

table getPedAnimationData ( ped thePed )

Required Arguments

  • thePed: the player or ped you want to get the animation data of.

Returns

Returns a table containing information about animation. These keys are present in the table:

  • name: string - name of the animation
  • block_name: string - name of animation block
  • loop: boolean - is animation looping?
  • update_position: boolean - updating position
  • interruptible: boolean - is animation interruptible?
  • time: float - duration of the animation
  • start_time: float - starting point
  • finished: boolean - has animation finished playing?
  • speed: float - speed
  • blend_speed: float - blending speed

See Also