Skip to main content

Server

ItemCarKeys

ParameterTypeDescription
sourcenumber
actionstring'delete' or 'add'
platestring
-- import fxManifext | shared_scripts { '@mVehicle/import.lua' } 
Vehicles.ItemCarKeys(source, action, plate)
-- or
exports.mVehicle:ItemCarKeys(source, action, plate)

CreateVehicle

ParameterTypeDescription
CreateVehicleDatatableVehicle creation data
callbackfunctionCallback function
Vehicles.CreateVehicle(CreateVehicleData, callback)

CreateVehicleId

ParameterTypeDescription
CreateVehicleDatatableVehicle creation data
callbackfunctionCallback function
Vehicles.CreateVehicleId(CreateVehicleData, callback)

HasKeys

Checks if the player has the keys / also checks if he has access to the vehicle.

ParameterTypeDescription
sourcenumer
entitynumer
Vehicles.HasKey(source, entity)

AddTemporalVehicle

Sets the entity under mVehicle control, allowing the player to open/close the doors or turn on/off the engine.

ParameterTypeDescription
entitynumer
Vehicles.AddTemporalVehicle(src,entity) 
-- export
exports.mVehicle.AddTemporalVehicle(src, entity)

ControlVehicle

ParameterTypeDescription
entitynumber
Vehicles.ControlVehicle(entity)

DeleteFromTable

ParameterTypeDescription
entitynumber
deleteVehicle?booleanDespawn vehicle
  • Deletes the entity from the mVehicles table,
Vehicles.DeleteFromTable(entity, deleteVehicle)

GetClientProps

ParameterTypeDescription
SourceIDnumberSource ID
VehicleNetworkIDnumberVehicle Network ID
local vehicleProps = Vehicles.GetClientProps(SourceID, VehicleNetworkID)
or
local vehicleProps = exports.mVehicle.GetClientProps(SourceID, VehicleNetworkID)

GetVehicle

ParameterTypeDescription
entitynumberEntity ID
local Vehicle = Vehicles.GetVehicle(entity)

GetVehicleByPlate

ParameterTypeDescription
platestringVehicle plate
local vehicle = Vehicles.GetVehicleByPlate(plate)

GetVehicleId

ParameterTypeDescription
idnumberVehicle ID
local vehicle = Vehicles.GetVehicleByID(id)

GetAllPlayerVehicles

ParameterTypeDescription
sourcenumberPlayer source
VehicleTablebooleanTrue for vehicles from table, false for DB
haveKeysbooleanCheck if player has keys
local AllVechiles = Vehicles.GetAllPlayerVehicles(source, VehicleTable, haveKeys)

SetVehicleOwner

ParameterTypeDescription
datatableVehicle owner data
Vehicles.SetVehicleOwner(table)

SetCurrentVehicleOwner

ParameterTypeDescription
sourcenumberSource ID
Vehicles.SetCurrentVehicleOwner(source)

SaveAllVehicles

ParameterTypeDescription
deletebooleanTrue to delete vehicles
Vehicles.SaveAllVehicles(delete)

PlateExist

ParameterTypeDescription
platestringVehicle plate
return Vehicles.PlateExist(plate)

GeneratePlate

return Vehicles.GeneratePlate()

SpawnVehicles

return Vehicles.SpawnVehicles() -- SpawnAllVehicles with coords

DelAllVehicles

Vehicles.DelAllVehicles()

Vehicles.save

local save = Vehicles.save() -- true|false

GetVehicleCount

local count = Vehicles.GetVehicleCount() -- return cound vehicle spawned by mVehicle