Player::taskEnterVehicle: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
speed 1.0 = walk, 2.0 = run<br>p5 1 = normal, 3 = teleport to vehicle, 16 = teleport directly into vehicle<br>p6 is always 0<br><br>Usage of seat <br>-3 = bicycle seats<br>-1 = driver<br>0 = passenger<br>1 = left back seat<br>2 = right back seat<br>3 = outside left<br>4 = outside right
__TOC__
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.taskEnterVehicle(vehicle, timeout, seat, speed, p5, p6);</syntaxhighlight>
<pre>
player.taskEnterVehicle(vehicle, timeout, seat, speed, mode, p6);
</pre>
 
=== Required Arguments ===
=== Required Arguments ===
*'''vehicle:''' Vehicle handle or object
*'''vehicle:''' Vehicle handle or object
*'''timeout:''' int
*'''timeout:''' int
*'''seat:''' int
*'''seat:''' int
*'''speed:''' float
*'''speed:''' float ('''Speeds''': <code>1.0</code> Walking, <code>2.0</code> Running)
*'''p5:''' int
*'''mode:''' int ('''Modes''': <code>1</code> Moves to the vehicle, <code>3</code> Teleport to the vehicle, <code>16</code> Teleports directly intro vehicle, <code>8</code> Jacks the vehicle, <code>262144</code> Enters the vehicle from the opposite door, <code>524288</code> Opens door without entering vehicle)
*'''p6:''' unknown (to be checked)
*'''p6:''' int (Always 0)
 
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<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>
<syntaxhighlight lang="javascript" highlight="5">
let Ped = mp.peds.new(mp.game.joaat('MP_F_Freemode_01'), new mp.Vector3( 100.0, -100.0, 25.0), 270.0, (streamPed) => {
// TODO Example
    // Ped Streamed
</syntaxhighlight>
    streamPed.setAlpha(0);
</div>
}, player.dimension);
 
let Veh = mp.vehicles.new(mp.game.joaat("turismor"), new mp.Vector3(-421.88, 1136.86, 326),
    {
        numberPlate: "ADMIN",
        color: [[255, 0, 0],[255,0,0]]
    });
 
Ped.taskEnterVehicle(Veh.handle, 10000, -1, 1, 1, 0);
</pre>
}}


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

Latest revision as of 11:02, 19 May 2020

Syntax

player.taskEnterVehicle(vehicle, timeout, seat, speed, mode, p6);

Required Arguments

  • vehicle: Vehicle handle or object
  • timeout: int
  • seat: int
  • speed: float (Speeds: 1.0 Walking, 2.0 Running)
  • mode: int (Modes: 1 Moves to the vehicle, 3 Teleport to the vehicle, 16 Teleports directly intro vehicle, 8 Jacks the vehicle, 262144 Enters the vehicle from the opposite door, 524288 Opens door without entering vehicle)
  • p6: int (Always 0)

Return value

  • Undefined

Example

Client-Side
let Ped = mp.peds.new(mp.game.joaat('MP_F_Freemode_01'), new mp.Vector3( 100.0, -100.0, 25.0), 270.0, (streamPed) => {
    // Ped Streamed
    streamPed.setAlpha(0);
}, player.dimension);

let Veh = mp.vehicles.new(mp.game.joaat("turismor"), new mp.Vector3(-421.88, 1136.86, 326),
    {
        numberPlate: "ADMIN",
        color: [[255, 0, 0],[255,0,0]]
    });

Ped.taskEnterVehicle(Veh.handle, 10000, -1, 1, 1, 0);

See also