Skip to content

Vehicles Contract

Contract: IVehicles
Default provider: shiva-vehicles

Manages owned vehicles and garages.

Methods

IVehicles:getVehicles(serverId)

Get all vehicles owned by a player.

lua
local vehicles = container:make('IVehicles')
local owned = vehicles:getVehicles(source)

Returns: table — list of VehicleData


IVehicles:getVehicle(vehicleId)

Get a specific vehicle by ID.


IVehicles:spawnVehicle(serverId, vehicleId, coords, heading)

Spawn an owned vehicle.


IVehicles:storeVehicle(vehicleId)

Store a vehicle back in the garage.


IVehicles:addVehicle(serverId, model, plate, data?)

Give a player a vehicle.

Released under the MIT License.