Player::setIntoVehicle: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(3 intermediate revisions by 3 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]<br><br>Moreinfo of Seat Index<br>DriverSeat = -1<br>Passenger = 0<br>Left Rear = 1<br>RightRear = 2
This function puts ped into vehicle.
 
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>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.setIntoVehicle(vehicle, seatIndex);</syntaxhighlight>
<syntaxhighlight lang="javascript">player.setIntoVehicle(vehicle, seatIndex);</syntaxhighlight>
Line 8: 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