Oakwood
  • Introduction
  • Server Setup
  • Public API
    • Events
    • Player
    • Vehicle
    • HUD
    • Camera
    • Chat
    • Vehicle-Player
    • Miscellaneous
  • Languages
    • NodeJS
  • Server API
  • Assets
    • Asset: Vehicle Models
    • Asset: Player models
  • Tutorials
    • Build Your Own Language Support
      • 1. Overview
      • 2. Connection
      • 3. Native Calls
      • 4. Events
      • 5. Wrap-up
Powered by GitBook
On this page
  • Player put
  • Player remove
  • Player inside
  • Player seat get
  • Player at seat

Was this helpful?

  1. Public API

Vehicle-Player

This page describes the player-vehicle interaction API

Player put

vehiclePlayerPut(vehicle, player, seat_id)

Puts player into a vehicle at a specified seat.

Remarks

Arguments

Type

Description

vehicle

Vehicle ID

player

Player ID

seat_id

Seat slot

Returns

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)
})

Player remove

vehiclePlayerRemove(vehicle, player)

Removes player from a vehicle.

Remarks

Arguments

Type

Description

vehicle

Vehicle ID

player

Player ID

Returns

0 if successful, -1 if not in a vehicle.

// TODO

Player inside

vehiclePlayerInside(player)

Get the current vehicle player sits in.

Remarks

Arguments

Type

Description

player

Player ID

Returns

Vehicle ID or -1 if not inside a vehicle.

// TODO

Player seat get

vehiclePlayerSeatGet(vehicle, player)

Retrieves the seat slot of a player in specified vehicle

Remarks

Arguments

Type

Description

vehicle

Vehicle ID

player

Player ID

Returns

Seat ID of a player or -1 if not inside specified vehicle.

// TODO

Player at seat

vehiclePlayerAtSeat(vehicle, seat_id)

Retrieves a player ID at a specified seat slot of a specified vehicle.

Remarks

Arguments

Type

Description

vehicle

Vehicle ID

seat_id

Seat slot

Returns

Player ID at a specified seat or -1 if seat is empty.

// TODO
PreviousChatNextMiscellaneous

Last updated 5 years ago

Was this helpful?