Player::taskStartScenarioInPlace: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
m (Replaced HTML with template)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Plays a scenario on a Ped at their current location.<br><br>unkDelay - Usually 0 or -1, doesn't seem to have any effect. Might be a delay between sequences.<br>playEnterAnim - Plays the 'Enter' anim if true, otherwise plays the 'Exit' anim. Scenarios that don't have any 'Enter' anims won't play if this is set to true.<br><br>[[Scenarios|Scenario List]]
Plays a scenario on a player at their current location.<br><br>
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.taskStartScenarioInPlace(scenarioName, unkDelay, playEnterAnim);</syntaxhighlight>
<pre>player.taskStartScenarioInPlace(scenarioName, unkDelay, playEnterAnim);</pre>
 
=== Required Arguments ===
=== Required Arguments ===
*'''scenarioName:''' String
*'''scenarioName:''' {{RageType|String}} ( [[Scenarios|Scenario List]] )
*'''unkDelay:''' int
*'''unkDelay:''' {{RageType|Int}} (0 or -1 loops infinitely, anything else will only make it run once)
*'''playEnterAnim:''' Boolean
*'''playEnterAnim:''' {{RageType|Boolean}} (True = Play the 'enter' animation, False = Exit animation)
===Return value===
 
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
This will play the drilling scenario and constantly loop.
// todo
{{ClientsideCode|
</syntaxhighlight>
<pre>
mp.events.add('playDrillScenario', () => {
    mp.players.local.taskStartScenarioInPlace('WORLD_HUMAN_CONST_DRILL', 0, false);
});
</pre>
}}
 
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

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