diff --git a/resources/[carscripts]/jg-advancedgarages/config/config.lua b/resources/[carscripts]/jg-advancedgarages/config/config.lua index e35d58bde..5d0478e2b 100644 --- a/resources/[carscripts]/jg-advancedgarages/config/config.lua +++ b/resources/[carscripts]/jg-advancedgarages/config/config.lua @@ -1,4 +1,4 @@ --- Generated with https://configurator.jgscripts.com at 8/6/2025, 2:03:39 PM +-- Generated with https://configurator.jgscripts.com at 8/6/2025, 2:46:29 PM Config = {} Config.Locale = 'de' @@ -34,12 +34,12 @@ Config.EnableTransfers = { betweenGarages = false, betweenPlayers = true, } -Config.AllowInfiniteVehicleSpawns = false -Config.JobGaragesAllowInfiniteVehicleSpawns = false +Config.AllowInfiniteVehicleSpawns = true +Config.JobGaragesAllowInfiniteVehicleSpawns = true Config.GangGaragesAllowInfiniteVehicleSpawns = false Config.GarageVehicleReturnCost = 0 Config.GarageVehicleReturnCostSocietyFund = false -Config.GarageShowBlips = false +Config.GarageShowBlips = true Config.GarageUniqueBlips = false Config.GarageUniqueLocations = true Config.GarageEnableInteriors = true @@ -552,7 +552,7 @@ Config.JobGarageLocations = { }, }, } -Config.GangGarageShowBlips = true +Config.GangGarageShowBlips = false Config.GangGarageUniqueBlips = false Config.GangGarageSetVehicleCommand = 'setgangvehicle' Config.GangGarageRemoveVehicleCommand = 'removegangvehicle' diff --git a/resources/[phone]/roadphone/server/serverAPI/valet.lua b/resources/[phone]/roadphone/server/serverAPI/valet.lua index 83fb5e70f..c82af39d8 100644 --- a/resources/[phone]/roadphone/server/serverAPI/valet.lua +++ b/resources/[phone]/roadphone/server/serverAPI/valet.lua @@ -6,58 +6,42 @@ QBCore.Functions.CreateCallback("roadphone:valet:getCars", function(source, cb) return; end - local result + MySQL.Async.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @citizenid and type = @type and `impound` = @impound", { + ['@impound'] = 0, + ['@citizenid'] = xPlayer.PlayerData.citizenid, + ['@type'] = "car" + }, function(result) + local cachedvehicles = {} - if Config.JGAdvancedGarages then - result = MySQL.Sync.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @identifier and `impound` = @impound", { - ['@impound'] = 0, - ['@identifier'] = xPlayer.PlayerData.citizenid - }) - else - result = MySQL.Sync.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @identifier", { - ['@identifier'] = xPlayer.PlayerData.citizenid - }) - end + for i = 1, #result do + table.insert(cachedvehicles, { + plate = result[i].plate, + vehicle = result[i].vehicle, -- result[i].vehicle, + type = 'car', + hash = result[i].hash, + garage = result[i].garage_id, + stored = result[i].in_garage + }) - local cachedvehicles = {} + end - for i = 1, #result do + cb(cachedvehicles) - local Garage = result[i].garage_id + end) - table.insert(cachedvehicles, { - plate = result[i].plate, - vehicle = result[i].vehicle, - hash = result[i].hash, - garage = result[i].garage, - stored = result[i].state - }) - - end - - cb(cachedvehicles) - end) - QBCore.Functions.CreateCallback('roadphone:valet:loadVehicle', function(source, cb, plate) local valetCheck = valetServerSideCheck(plate) - local xPlayer = QBCore.Functions.GetPlayer(source) if valetCheck ~= false then cb(false, valetCheck) return; end - if not xPlayer then - cb(false) - return; - end - - MySQL.Async.fetchAll('SELECT * FROM ' .. Config.OwnedVehiclesTable .. ' WHERE `plate` = @plate AND `citizenid` = @identifier', { - ['@plate'] = plate, - ['@identifier'] = xPlayer.PlayerData.citizenid + MySQL.Async.fetchAll('SELECT * FROM ' .. Config.OwnedVehiclesTable .. ' WHERE `plate` = @plate', { + ['@plate'] = plate }, function(vehicle) cb(vehicle) end) @@ -80,7 +64,7 @@ QBCore.Functions.CreateCallback('roadphone:valet:checkMoney', function(source, c TriggerClientEvent("roadphone:sendNotification", source, { apptitle = "APP_VALET_NAME", title = "APP_VALET_CAR_ONTHEWAY", - img = "/public/img/Apps/light_mode/valet.webp" + img = "/public/img/Apps/valet.jpg" }) discordLog("9807270", "Valet", xPlayer.PlayerData.name .. ' ' .. Lang:t('info.valet_car_delivered_2', { value = Config.ValetDeliveryPrice }), 'RoadPhone - Valet', nil, Cfg.ValetWebhook) @@ -90,7 +74,7 @@ QBCore.Functions.CreateCallback('roadphone:valet:checkMoney', function(source, c TriggerClientEvent("roadphone:sendNotification", source, { apptitle = "APP_VALET_NAME", title = "APP_VALET_NOTENOUGHMONEY", - img = "/public/img/Apps/light_mode/valet.webp" + img = "/public/img/Apps/valet.jpg" }) cb(false) @@ -101,17 +85,8 @@ end) RegisterServerEvent("roadphone:valetCarSetOutside") AddEventHandler("roadphone:valetCarSetOutside", function(plate) - - if Config.cdGarages or Config.JGAdvancedGarages then - MySQL.Async.execute('UPDATE '..Config.OwnedVehiclesTable..' SET `in_garage` = @in_garage WHERE `plate` = @plate', { - ['@plate'] = plate, - ['@in_garage'] = 0, - }) - return - end - - MySQL.Async.execute("UPDATE " .. Config.OwnedVehiclesTable .. " SET `state` = @stored WHERE `plate` = @plate", { - ["@plate"] = plate, - ["@stored"] = 0 + MySQL.Async.execute('UPDATE '..Config.OwnedVehiclesTable..' SET `in_garage` = @in_garage WHERE `plate` = @plate', { + ['@plate'] = plate, + ['@in_garage'] = 0, }) end)