Player::taskEnterVehicle

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

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)
  • 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