🚗Vehicle Shop Integration
Learn how to seamlessly integrate our system with your vehicle shop.
Incorporating our system with your vehicle shop requires specific modifications to your server's vehicle shop code. You should remove vehicle spawning and database entry for vehicle entry in your shop's code, as our resource REQUIRES to handle these functions. It is REQUIRED to perform these adjustments exclusively within our resource.
local Player = QBCore.Functions.GetPlayer(src)
local data = {
source = src, --Who is the source. Send the Player ID. Also make sure it is number!
hash = GetHashKey(vehName), --The hash number of the vehicle
coords = vehicle.location, --This is a vector 4 location. Inlcludes x,y,z,heading.
identifier = owner, --Requires the owner of the vehicle. (Player.PlayerData.citizenid - QBCORE)
license = Player.PlayerData.license, --This is license id, you can leave it blank
vehicleName = vehName, --The name of the vehicle in a string format - ("adder")
balance = 0, --Only for QBCORE
vehPaymentsLeft = 0, --Only for QBCORE
paymentAmount = tonumber(vehiclePrice), --Only for QBCORE
financeTime = 0, --Only for QBCORE
}
TriggerEvent("realisticVehicleSystem:server:addVehicle", data)
In case you encounter a server-sided error indicating that database.lua - line x is nil
, you should resolve this by adding an additional parameter. The TriggerEvent in your vehicle shop should look like this:
TriggerEvent("realisticVehicleSystem:server:addVehicle", 1, data)
Last updated
Was this helpful?