Vehicle-Player
This page describes the player-vehicle interaction API
vehiclePlayerPut(vehicle, player, seat_id)
Puts player into a vehicle at a specified seat.
0 if successful, -1 if occupied already
oak.cmd('putcar', async (pid, model) => {
const veh = await spawncar(pid, model, false)
oak.vehiclePlayerPut(veh, pid, 0)
})
vehiclePlayerRemove(vehicle, player)
Removes player from a vehicle.
0 if successful, -1 if not in a vehicle.
vehiclePlayerInside(player)
Get the current vehicle player sits in.
Vehicle ID or -1 if not inside a vehicle.
Player seat get
vehiclePlayerSeatGet(vehicle, player)
Retrieves the seat slot of a player in specified vehicle
Seat ID of a player or -1 if not inside specified vehicle.
vehiclePlayerAtSeat(vehicle, seat_id)
Retrieves a player ID at a specified seat slot of a specified vehicle.
Player ID at a specified seat or -1 if seat is empty.