Player::setIntoVehicle: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
Line 16: 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