SetPedAnimation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 6: Line 6:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setPedAnimation ( ped thePed, string block, string anim, [ bool loop = false, bool updatePosition = true ] )
bool setPedAnimation ( ped thePed, string block, string anim, [ bool loop = false, bool updatePosition = false ] )
</syntaxhighlight>
</syntaxhighlight>
Or, to stop the current animation:
Or, to stop the current animation:
Line 20: Line 20:
===Optional Arguments===
===Optional Arguments===
*'''loop:''' indicates whether or not the animation will loop.
*'''loop:''' indicates whether or not the animation will loop.
*'''updatePosition:''' sets whether or not the animation is allowed to change the ped's position (e.g. walking and running animations).
*'''updatePosition:''' will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations.


===Returns===
===Returns===

Revision as of 12:56, 11 June 2008

Sets the current animation of a player or ped.

Syntax

bool setPedAnimation ( ped thePed, string block, string anim, [ bool loop = false, bool updatePosition = false ] )

Or, to stop the current animation:

bool setPedAnimation ( ped thePed, bool false )

Required Arguments

  • thePed: the player or ped you want to apply an animation to.
  • block: the animation block's name.
  • anim: the name of the animation within the block.

Optional Arguments

  • loop: indicates whether or not the animation will loop.
  • updatePosition: will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations.

Returns

Returns true if succesful, false otherwise.

Example

See Also