Player::setIntoVehicle: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Ped: The ped to warp.<br>vehicle: The vehicle to warp the ped into.<br>Seat_Index: [-1 is driver seat, -2 first free passenger seat]
This function puts ped into vehicle.


More info of Seat Index<br>DriverSeat = 0<br>Passenger = 1<br>Left Rear = 2<br>RightRear = 3
Seats:
* -1 - driver seat
* 0 - passenger seat 1
* 1 - passenger seat 2
* 2 - passenger seat 3


<b>(note this is for normal vehicles with 4 seats)</b>
<b>(note this is for normal vehicles with 4 seats)</b>
Line 12: Line 16:
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
{{ClientsideCode|
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
let vehicle = mp.vehicles.new(mp.game.joaat('sultan'), mp.players.local.position, {
    numberPlate: 'yess'
});
mp.players.local.setIntoVehicle(vehicle.handle, -1);
</syntaxhighlight>
</syntaxhighlight>
}}
==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 00:14, 17 September 2021

This function puts ped into vehicle.

Seats:

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

(note this is for normal vehicles with 4 seats)

Syntax

player.setIntoVehicle(vehicle, seatIndex);

Required Arguments

  • vehicle: Vehicle handle or object
  • seatIndex: int

Return value

  • Undefined

Example

Client-Side
let vehicle = mp.vehicles.new(mp.game.joaat('sultan'), mp.players.local.position, {
    numberPlate: 'yess'
});
mp.players.local.setIntoVehicle(vehicle.handle, -1);

See also