-- all player vehiclesVehicles.VehickeKeysMenu()-- Specific plate, Vehicles.VehickeKeysMenu('MONO 420', function()print('On Close menu or Set/remove key player')end)
Vehicles.CreateVehicle(VehicleData, CallBack)local CreateVehicleData = {-- if vehicle temporary | date format 'YYYYMMDD HH:MM' example '20240422 03:00' - or false temporary = ?, -- string or false, nil ... job = ?,-- Set vehicle Owner? if Temporary date set true setOwner = ?, -- player identifier owner = ?, -- same to owner identifier = ?, coords =vector4(1.0, 1.0, 1.0, 1.0), -- Coords spawn table or vector 4-- Vehicle Data-- can set your custom props here or use lib.GetVehicleProps() table... vehicle = { model ='sulta', plate = Vehicles.GeneratePlate(), fuelLevel =100, color1 = [0,0,0], color2 = [0,0,0], },Vehicles.CreateVehicle(CreateVehicleData, function(data,action)print(json.encode(data, { indent =true} ))end)}
Get Vehicle
local Vehicle = Vehicles.GetVehicle(entity) Vehicle.SetMetadata(key, value)-- Example-- Vehicle.SetMetadata('stolen', { stolenBy = 'Mono Garage'})Vehicle.DeleteMetadata(key) -- Example-- Vehicle.DeleteMetadata('stolen')Vehicle.GetMetadata(key) -- Example-- by key Vehicle.GetMetadata('stolen') or Vehicles.GetMetadata() return all-- local metadata = Vehicle.GetMetadata('stolen')-- print(metadata.stolenBy) --- or client/server State -- local metadata = Entity(data.entity).state.metadata-- print(metadata.stolenBy) Vehicle.AddKey(source) Vehicle.RemoveKey(source)Vehicle.SaveProps(props)-- To use in garage scriptVehicle.StoreVehicle(parking, props, license)Vehicle.RetryVehicle(coords)Vehicle.ImpoundVehicle(parking, price, note, date)Vehicle.RetryImpound(ToGarage, coords)-- Set Fake Plate to vehicleVehicle.SetFakePlate('FAKETAXI')-- To remove Vehicle.SetFakePlate(false)-- Delete DataBase vehicleVehicle.DeleteVehicleDB()
Get Vehicle By Plate
retunr Vehicles.GetVehicle()
local Vehicles.GetVehicleByPlate(plate)
Get Vehicle Id
retunrvehicle from database
local vehicle = Vehicles.GetVehicleId(id)
Get Vehicles from Identifier
local AllVechiles = Vehicles.GetAllVehicles(identifier)