Player::putIntoVehicle

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

This function puts player into vehicle.

Syntax

player.putIntoVehicle(Vehicle vehicle, Number seat)

Seats:

  • -1 - driver seat
  • 0 - passenger seat 1
  • 1 - passenger seat 2
  • 2 - passenger seat 3

In >1.0 Seats:

  • 0 - driver seat
  • 1 - passenger seat 1
  • 2 - passenger seat 2
  • 3 - passenger seat 3

Examples

Server-Side
mp.events.addCommand('veh', (player: MpPlayer, text: string) => {
    if (text == undefined) {
        let veh = mp.vehicles.new(mp.joaat('T20'), player.position);
        player.putIntoVehicle(veh, -1);
    } else {
        let veh = mp.vehicles.new(mp.joaat(text), player.position);
        player.putIntoVehicle(veh, -1);
    }
});

See Also