Player::taskLeaveVehicle: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Flags from decompiled scripts:<br>0 = normal exit and closes door.<br>1 = normal exit and closes door.<br>16 = teleports outside, door kept closed.<br>64 = normal exit and closes door, maybe a bit slower animation than 0.<br>256 = normal exit but does not close the door.<br>4160 = ped is throwing himself out, even when the vehicle is still.<br>262144 = ped moves to passenger seat first, then exits normally<br><br>Others to be tried out: 320, 512, 131072.
Flags from decompiled scripts:<br>0 = normal exit and closes door.<br>1 = normal exit and closes door.<br>16 = teleports outside, door kept closed.<br>64 = normal exit and closes door, maybe a bit slower animation than 0.<br>256 = normal exit but does not close the door.<br>4160 = ped is throwing himself out, even when the vehicle is still.<br>262144 = ped moves to passenger seat first, then exits normally<br><br>Others to be tried out: 320, 512, 131072.
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.taskLeaveVehicle(vehicle, flags);</syntaxhighlight>
<pre>player.taskLeaveVehicle(vehicle, flags);</pre>
=== Required Arguments ===
=== Required Arguments ===
*'''vehicle:''' Vehicle handle or object
*'''vehicle:''' Vehicle handle or object
Line 8: Line 8:
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
Forces the local player to exit his current vehicle
// todo
<pre>
</syntaxhighlight>
let localVeh = mp.players.local.vehicle;
if (localVeh) {
    mp.players.local.taskLeaveVehicle(localVeh.handle, 0);
}
</pre>
 
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 17:43, 16 August 2018

Flags from decompiled scripts:
0 = normal exit and closes door.
1 = normal exit and closes door.
16 = teleports outside, door kept closed.
64 = normal exit and closes door, maybe a bit slower animation than 0.
256 = normal exit but does not close the door.
4160 = ped is throwing himself out, even when the vehicle is still.
262144 = ped moves to passenger seat first, then exits normally

Others to be tried out: 320, 512, 131072.

Syntax

player.taskLeaveVehicle(vehicle, flags);

Required Arguments

  • vehicle: Vehicle handle or object
  • flags: int

Return value

  • Undefined

Example

Forces the local player to exit his current vehicle

let localVeh = mp.players.local.vehicle;
if (localVeh) {
    mp.players.local.taskLeaveVehicle(localVeh.handle, 0);
}

See also