🚗Vehicle Shop Integration

Learn how to seamlessly integrate our system with your vehicle shop.

In the example below, we are creating an array with all the necessary variables and values to be parsed through the event.

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)

Last updated

Was this helpful?