Player::taskStartScenarioInPlace: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
m (Replaced HTML with template)
 
(4 intermediate revisions by 3 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>----<br><br>From 'am_hold_up.ysc.c4' at line 339:<br><br>Player::TASK_START_SCENARIO_IN_PLACE(NETWORK::NET_TO_PED(l_8D._f4), sub_adf(), 0, 1);<br><br>I'm unsure of what the last two parameters are, however sub_adf() randomly returns 1 of 3 scenarios, those being:<br>WORLD_HUMAN_SMOKING<br>WORLD_HUMAN_HANG_OUT_STREET<br>WORLD_HUMAN_STAND_MOBILE<br><br>This makes sense, as these are what I commonly see when going by a liquor store.<br>-------------------------<br>List of scenarioNames: pastebin.com/6mrYTdQv<br>(^ Thank you so fucking much for this)<br><br>Also these:<br>WORLD_FISH_FLEE<br>DRIVE<br>WORLD_HUMAN_HIKER<br>WORLD_VEHICLE_ATTRACTOR<br>WORLD_VEHICLE_BICYCLE_MOUNTAIN<br>WORLD_VEHICLE_BIKE_OFF_ROAD_RACE<br>WORLD_VEHICLE_BIKER<br>WORLD_VEHICLE_CONSTRUCTION_PASSENGERS<br>WORLD_VEHICLE_CONSTRUCTION_SOLO<br>WORLD_VEHICLE_DRIVE_PASSENGERS<br>WORLD_VEHICLE_DRIVE_SOLO<br>WORLD_VEHICLE_EMPTY<br>WORLD_VEHICLE_PARK_PARALLEL<br>WORLD_VEHICLE_PARK_PERPENDICULAR_NOSE_IN<br>WORLD_VEHICLE_POLICE_BIKE<br>WORLD_VEHICLE_POLICE_CAR<br>WORLD_VEHICLE_POLICE_NEXT_TO_CAR<br>WORLD_VEHICLE_SALTON_DIRT_BIKE<br>WORLD_VEHICLE_TRUCK_LOGS
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