Difference between revisions of "EngineRestoreAnimation"

From Multi Theft Auto: Wiki
Jump to: navigation, search
(Created page with "__NOTOC__ {{Client function}} This function restores internal (default) animations that were replaced using engineReplaceAnimation function. This fu...")
 
(Added examples, and separated optional arguments from required)
Line 14: Line 14:
 
===Required Arguments===
 
===Required Arguments===
 
*'''thePed:''' the [[player]] or [[ped]] you want to restore an animation(s) for.
 
*'''thePed:''' the [[player]] or [[ped]] you want to restore an animation(s) for.
 +
 +
===Optional Arguments===
 +
{{OptionalArg}}
 
*'''InternalBlockName:''' the [[Animations|internal block]] name.
 
*'''InternalBlockName:''' the [[Animations|internal block]] name.
 
*'''InternalAnimName:''' the [[Animations|internal animation]] name inside InternalBlockName.
 
*'''InternalAnimName:''' the [[Animations|internal animation]] name inside InternalBlockName.
 +
 
===Returns===
 
===Returns===
 
Returns ''true'' on success, ''false'' in case of failure.
 
Returns ''true'' on success, ''false'' in case of failure.
  
 
==Example==
 
==Example==
 +
'''Example 1:''' This example restores all replaced animations within every block for the local player.
 +
<section name="client.lua" class="client" show="true">
 +
<syntaxhighlight lang="lua">
 +
engineRestoreAnimation ( localPlayer )
 +
</syntaxhighlight>
 +
</section>
 +
'''Example 2:''' This example restores all replaced animations only within "ped" block for the local player.
 +
<section name="client.lua" class="client" show="true">
 +
<syntaxhighlight lang="lua">
 +
engineRestoreAnimation ( localPlayer, "ped" )
 +
</syntaxhighlight>
 +
</section>
 +
'''Example 3:''' This example restores "weapon_crouch" animation within "ped" block for the local player.
 +
<section name="client.lua" class="client" show="true">
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
-- @todo
+
engineRestoreAnimation ( localPLayer, "ped", "weapon_crouch" )
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
</section>
  
 
==See Also==
 
==See Also==
 
{{Engine_functions}}
 
{{Engine_functions}}

Revision as of 21:34, 18 June 2018

This function restores internal (default) animations that were replaced using engineReplaceAnimation function. This function only affects a specific player or ped just like engineReplaceAnimation.

If only 1st parameter (ped) is provided to this function, all replaced animations are restored. If block name is also provided for 2nd parameter, then replaced animations within that block are restored. If 3rd parameter (animation name) is provided, then only that specific animation within that specific block is restored.

Syntax

bool engineRestoreAnimation ( ped thePed [, string InternalBlockName, string InternalAnimName ] )

Required Arguments

  • thePed: the player or ped you want to restore an animation(s) for.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

Returns

Returns true on success, false in case of failure.

Example

Example 1: This example restores all replaced animations within every block for the local player.

Click to collapse [-]
client.lua
engineRestoreAnimation ( localPlayer )

Example 2: This example restores all replaced animations only within "ped" block for the local player.

Click to collapse [-]
client.lua
engineRestoreAnimation ( localPlayer, "ped" )

Example 3: This example restores "weapon_crouch" animation within "ped" block for the local player.

Click to collapse [-]
client.lua
engineRestoreAnimation ( localPLayer, "ped", "weapon_crouch" )

See Also

FROM VERSION 1.5.6 r16365 ONWARDS