Player::taskStartScenarioInPlace: Difference between revisions

From RAGE Multiplayer Wiki
(Added example, cleaned up page)
m (Replaced HTML with template)
 
Line 1: Line 1:
Plays a scenario on a player at their current location.<br><br>
Plays a scenario on a player at their current location.<br><br>
==Syntax==
==Syntax==
<pre>player.taskStartScenarioInPlace(scenarioName, unkDelay, playEnterAnim);</pre>
<pre>player.taskStartScenarioInPlace(scenarioName, unkDelay, playEnterAnim);</pre>
=== Required Arguments ===
=== Required Arguments ===
*'''scenarioName:''' {{RageType|String}} ( [[Scenarios|Scenario List]] )
*'''scenarioName:''' {{RageType|String}} ( [[Scenarios|Scenario List]] )
Line 9: Line 11:
==Example==
==Example==
This will play the drilling scenario and constantly loop.
This will play the drilling scenario and constantly loop.
<div class="header" style="background-color: #AE4040; color: #FFFFFF; border: 2px solid #AE4040;">
{{ClientsideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div>
<pre>
<pre>
mp.events.add('playDrillScenario', () => {
mp.events.add('playDrillScenario', () => {
Line 16: Line 17:
});
});
</pre>
</pre>
</div>
}}


==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Latest revision as of 13:13, 26 October 2018

Plays a scenario on a player at their current location.

Syntax

player.taskStartScenarioInPlace(scenarioName, unkDelay, playEnterAnim);

Required Arguments

  • scenarioName: String ( Scenario List )
  • unkDelay: Int (0 or -1 loops infinitely, anything else will only make it run once)
  • playEnterAnim: Boolean (True = Play the 'enter' animation, False = Exit animation)

Example

This will play the drilling scenario and constantly loop.

Client-Side
mp.events.add('playDrillScenario', () => {
    mp.players.local.taskStartScenarioInPlace('WORLD_HUMAN_CONST_DRILL', 0, false);
});

See also