ed
This commit is contained in:
parent
6d22d5f77c
commit
63fbc60a00
86 changed files with 8352 additions and 3428 deletions
|
@ -0,0 +1,22 @@
|
|||
if (Config.Framework == "auto" and GetResourceState("qb-core") == "started") or Config.Framework == "QBCore" then
|
||||
-- Player data
|
||||
Globals.PlayerData = QBCore.Functions.GetPlayerData()
|
||||
|
||||
RegisterNetEvent("QBCore:Client:OnPlayerLoaded")
|
||||
AddEventHandler("QBCore:Client:OnPlayerLoaded", function()
|
||||
Globals.PlayerData = QBCore.Functions.GetPlayerData()
|
||||
TriggerEvent("jg-advancedgarages:client:update-blips-text-uis")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("QBCore:Client:OnJobUpdate")
|
||||
AddEventHandler("QBCore:Client:OnJobUpdate", function(job)
|
||||
Globals.PlayerData.job = job
|
||||
TriggerEvent("jg-advancedgarages:client:update-blips-text-uis")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("QBCore:Client:OnGangUpdate")
|
||||
AddEventHandler("QBCore:Client:OnGangUpdate", function(gang)
|
||||
Globals.PlayerData.gang = gang
|
||||
TriggerEvent("jg-advancedgarages:client:update-blips-text-uis")
|
||||
end)
|
||||
end
|
|
@ -0,0 +1,55 @@
|
|||
if (Config.Framework == "auto" and GetResourceState("qb-core") == "started") or Config.Framework == "QBCore" then
|
||||
-- qb-phone fix
|
||||
QBCore.Functions.CreateCallback("jg-advancedgarages:server:GetVehiclesPhone", function(source, cb)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
|
||||
local vehicles = MySQL.query.await("SELECT * FROM player_vehicles WHERE citizenid = ? AND job_vehicle = ? AND gang_vehicle = ?", {Player.PlayerData.citizenid, 0, 0})
|
||||
|
||||
for i, vehicle in pairs(vehicles) do
|
||||
local vehShared = QBCore.Shared.Vehicles[vehicle.vehicle]
|
||||
local vehBrand, vehName, vehState
|
||||
local vehGarage = vehicle.garage_id
|
||||
|
||||
if vehShared then
|
||||
vehBrand = vehShared.brand
|
||||
vehName = vehShared.name
|
||||
else
|
||||
vehBrand = ""
|
||||
vehName = vehicle.vehicle
|
||||
end
|
||||
|
||||
if vehicle.impound == 1 then
|
||||
vehGarage = Locale.impound
|
||||
vehState = json.decode(vehicle.impound_data).reason
|
||||
elseif vehicle.in_garage then
|
||||
vehState = Locale.inGarage
|
||||
else
|
||||
vehState = Locale.notInGarage
|
||||
end
|
||||
|
||||
vehicles[i] = {
|
||||
fullname = vehBrand .. " " .. vehName,
|
||||
brand = vehBrand,
|
||||
model = vehName,
|
||||
garage = vehGarage,
|
||||
state = vehState,
|
||||
plate = vehicle.plate,
|
||||
fuel = vehicle.fuel,
|
||||
engine = vehicle.engine,
|
||||
body = vehicle.body
|
||||
}
|
||||
end
|
||||
|
||||
cb(vehicles)
|
||||
end)
|
||||
|
||||
-- qb-vehiclesales fix
|
||||
QBCore.Functions.CreateCallback("qb-garage:server:checkVehicleOwner", function(source, cb, plate)
|
||||
local src = source
|
||||
local pData = QBCore.Functions.GetPlayer(src)
|
||||
|
||||
local result = MySQL.single.await("SELECT * FROM player_vehicles WHERE plate = ? AND citizenid = ?", {plate, pData.PlayerData.citizenid})
|
||||
if result then cb(true, result.balance)
|
||||
else cb(false) end
|
||||
end)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue