Player::stopAnimation: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "This method stops animation of the player ==Parameters== None ==Syntax== <div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;"> <d...")
 
 
(3 intermediate revisions by 3 users not shown)
Line 4: Line 4:


==Syntax==
==Syntax==
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
<pre>
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<syntaxhighlight lang="javascript">
player.stopAnimation()
player.stopAnimation()
</syntaxhighlight>
</pre>
</div>


==Example==
==Example==
<syntaxhighlight lang="javascript">
{{ServersideCode|
// todo
<pre>
</syntaxhighlight>
// call this events from client side to do animation for 10s and stop it
 
mp.events.add("DoMedicalCheck", (player) => {
    player.playScenario('CODE_HUMAN_MEDIC_KNEEL');
    setTimeout(() => {
        player.stopAnimation();
    }, 10000)
})
</pre>
}}


==See Also==
==See Also==
{{Player_block}}
{{Player_block}}
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 14:56, 3 May 2021

This method stops animation of the player

Parameters

None

Syntax

player.stopAnimation()

Example

Server-Side
// call this events from client side to do animation for 10s and stop it

mp.events.add("DoMedicalCheck", (player) => {
    player.playScenario('CODE_HUMAN_MEDIC_KNEEL');
    setTimeout(() => {
        player.stopAnimation();
    }, 10000)
})

See Also