qbx_vehiclesales
Make qbx_vehiclesales compatible with our Dealerships V2
Go to file qbx_vehiclesales/server/main.lua.lua
.lualib.callback.register('jg-advancedgarages:server:checkVehicleOwner', function(source, plate)
local player = exports.qbx_core:GetPlayer(source)
local result = MySQL.single.await('SELECT * FROM player_vehicles WHERE plate = ? AND citizenid = ?', {plate, player.PlayerData.citizenid})
if result and result.id then
local financeRow = MySQL.single.await('SELECT * FROM vehicle_financing WHERE vehicleId = ?', {result.id})
if financeRow and financeRow.balance > 0 then
exports.qbx_core:Notify(source, "You cannot sell a vehicle that is under finance", 'error')
return false
end
return true, financeRow?.balance or 0
end
return false
end)Go to file qbx_vehiclesales/client/main.lua
qbx_vehiclesales/client/main.lua
Last updated
Was this helpful?

