EngineRestoreAnimation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(Restored version transclusion)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{New items|3.0156|1.5.5-rev|
{{New feature/item|3.0156|1.5.5|12195|
This function restores internal (default) animations that were replaced using [[EngineReplaceAnimation|engineReplaceAnimation]] function. This function only affects a specific [[player]] or [[ped]] just like [[EngineReplaceAnimation|engineReplaceAnimation]].  
This function restores internal (default) animations that were replaced using [[EngineReplaceAnimation|engineReplaceAnimation]] function. This function only affects a specific [[player]] or [[ped]] just like [[EngineReplaceAnimation|engineReplaceAnimation]].  


If only 1st parameter ([[Ped|ped]]) is provided to this function, all replaced animations are restored.  
If only 1st parameter ([[Ped|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 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.
If 3rd parameter (animation name) is provided, then only that specific animation within that specific block is restored.}}
|12213}}
 
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 26: Line 26:
==Example==
==Example==
'''Example 1:''' This example restores all replaced animations within every block for the local player.
'''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">
<syntaxhighlight lang="lua">
engineRestoreAnimation ( localPlayer )
engineRestoreAnimation( localPlayer )
</syntaxhighlight>
</syntaxhighlight>
</section>
 
'''Example 2:''' This example restores all replaced animations only within "ped" block for the local player.
'''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">
<syntaxhighlight lang="lua">
engineRestoreAnimation ( localPlayer, "ped" )
engineRestoreAnimation( localPlayer, "ped" )
</syntaxhighlight>
</syntaxhighlight>
</section>
 
'''Example 3:''' This example restores "weapon_crouch" animation within "ped" block for the local player.
'''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">
engineRestoreAnimation ( localPLayer, "ped", "weapon_crouch" )
engineRestoreAnimation( localPLayer, "ped", "weapon_crouch" )
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Engine_functions}}
{{Engine_functions}}

Latest revision as of 17:55, 18 July 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.

engineRestoreAnimation( localPlayer )

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

engineRestoreAnimation( localPlayer, "ped" )

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

engineRestoreAnimation( localPLayer, "ped", "weapon_crouch" )

See Also