forked from Simnation/Main
ed
This commit is contained in:
parent
f43cf424cf
commit
6778fbc673
2 changed files with 30 additions and 55 deletions
|
@ -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 = {}
|
||||||
Config.Locale = 'de'
|
Config.Locale = 'de'
|
||||||
|
@ -34,12 +34,12 @@ Config.EnableTransfers = {
|
||||||
betweenGarages = false,
|
betweenGarages = false,
|
||||||
betweenPlayers = true,
|
betweenPlayers = true,
|
||||||
}
|
}
|
||||||
Config.AllowInfiniteVehicleSpawns = false
|
Config.AllowInfiniteVehicleSpawns = true
|
||||||
Config.JobGaragesAllowInfiniteVehicleSpawns = false
|
Config.JobGaragesAllowInfiniteVehicleSpawns = true
|
||||||
Config.GangGaragesAllowInfiniteVehicleSpawns = false
|
Config.GangGaragesAllowInfiniteVehicleSpawns = false
|
||||||
Config.GarageVehicleReturnCost = 0
|
Config.GarageVehicleReturnCost = 0
|
||||||
Config.GarageVehicleReturnCostSocietyFund = false
|
Config.GarageVehicleReturnCostSocietyFund = false
|
||||||
Config.GarageShowBlips = false
|
Config.GarageShowBlips = true
|
||||||
Config.GarageUniqueBlips = false
|
Config.GarageUniqueBlips = false
|
||||||
Config.GarageUniqueLocations = true
|
Config.GarageUniqueLocations = true
|
||||||
Config.GarageEnableInteriors = true
|
Config.GarageEnableInteriors = true
|
||||||
|
@ -552,7 +552,7 @@ Config.JobGarageLocations = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Config.GangGarageShowBlips = true
|
Config.GangGarageShowBlips = false
|
||||||
Config.GangGarageUniqueBlips = false
|
Config.GangGarageUniqueBlips = false
|
||||||
Config.GangGarageSetVehicleCommand = 'setgangvehicle'
|
Config.GangGarageSetVehicleCommand = 'setgangvehicle'
|
||||||
Config.GangGarageRemoveVehicleCommand = 'removegangvehicle'
|
Config.GangGarageRemoveVehicleCommand = 'removegangvehicle'
|
||||||
|
|
|
@ -6,58 +6,42 @@ QBCore.Functions.CreateCallback("roadphone:valet:getCars", function(source, cb)
|
||||||
return;
|
return;
|
||||||
end
|
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
|
for i = 1, #result do
|
||||||
result = MySQL.Sync.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @identifier and `impound` = @impound", {
|
table.insert(cachedvehicles, {
|
||||||
['@impound'] = 0,
|
plate = result[i].plate,
|
||||||
['@identifier'] = xPlayer.PlayerData.citizenid
|
vehicle = result[i].vehicle, -- result[i].vehicle,
|
||||||
})
|
type = 'car',
|
||||||
else
|
hash = result[i].hash,
|
||||||
result = MySQL.Sync.fetchAll("SELECT * FROM " .. Config.OwnedVehiclesTable .. " WHERE `citizenid` = @identifier", {
|
garage = result[i].garage_id,
|
||||||
['@identifier'] = xPlayer.PlayerData.citizenid
|
stored = result[i].in_garage
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
|
||||||
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)
|
end)
|
||||||
|
|
||||||
|
|
||||||
QBCore.Functions.CreateCallback('roadphone:valet:loadVehicle', function(source, cb, plate)
|
QBCore.Functions.CreateCallback('roadphone:valet:loadVehicle', function(source, cb, plate)
|
||||||
|
|
||||||
local valetCheck = valetServerSideCheck(plate)
|
local valetCheck = valetServerSideCheck(plate)
|
||||||
local xPlayer = QBCore.Functions.GetPlayer(source)
|
|
||||||
|
|
||||||
if valetCheck ~= false then
|
if valetCheck ~= false then
|
||||||
cb(false, valetCheck)
|
cb(false, valetCheck)
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if not xPlayer then
|
MySQL.Async.fetchAll('SELECT * FROM ' .. Config.OwnedVehiclesTable .. ' WHERE `plate` = @plate', {
|
||||||
cb(false)
|
['@plate'] = plate
|
||||||
return;
|
|
||||||
end
|
|
||||||
|
|
||||||
MySQL.Async.fetchAll('SELECT * FROM ' .. Config.OwnedVehiclesTable .. ' WHERE `plate` = @plate AND `citizenid` = @identifier', {
|
|
||||||
['@plate'] = plate,
|
|
||||||
['@identifier'] = xPlayer.PlayerData.citizenid
|
|
||||||
}, function(vehicle)
|
}, function(vehicle)
|
||||||
cb(vehicle)
|
cb(vehicle)
|
||||||
end)
|
end)
|
||||||
|
@ -80,7 +64,7 @@ QBCore.Functions.CreateCallback('roadphone:valet:checkMoney', function(source, c
|
||||||
TriggerClientEvent("roadphone:sendNotification", source, {
|
TriggerClientEvent("roadphone:sendNotification", source, {
|
||||||
apptitle = "APP_VALET_NAME",
|
apptitle = "APP_VALET_NAME",
|
||||||
title = "APP_VALET_CAR_ONTHEWAY",
|
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)
|
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, {
|
TriggerClientEvent("roadphone:sendNotification", source, {
|
||||||
apptitle = "APP_VALET_NAME",
|
apptitle = "APP_VALET_NAME",
|
||||||
title = "APP_VALET_NOTENOUGHMONEY",
|
title = "APP_VALET_NOTENOUGHMONEY",
|
||||||
img = "/public/img/Apps/light_mode/valet.webp"
|
img = "/public/img/Apps/valet.jpg"
|
||||||
})
|
})
|
||||||
|
|
||||||
cb(false)
|
cb(false)
|
||||||
|
@ -101,17 +85,8 @@ end)
|
||||||
|
|
||||||
RegisterServerEvent("roadphone:valetCarSetOutside")
|
RegisterServerEvent("roadphone:valetCarSetOutside")
|
||||||
AddEventHandler("roadphone:valetCarSetOutside", function(plate)
|
AddEventHandler("roadphone:valetCarSetOutside", function(plate)
|
||||||
|
MySQL.Async.execute('UPDATE '..Config.OwnedVehiclesTable..' SET `in_garage` = @in_garage WHERE `plate` = @plate', {
|
||||||
if Config.cdGarages or Config.JGAdvancedGarages then
|
['@plate'] = plate,
|
||||||
MySQL.Async.execute('UPDATE '..Config.OwnedVehiclesTable..' SET `in_garage` = @in_garage WHERE `plate` = @plate', {
|
['@in_garage'] = 0,
|
||||||
['@plate'] = plate,
|
|
||||||
['@in_garage'] = 0,
|
|
||||||
})
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
MySQL.Async.execute("UPDATE " .. Config.OwnedVehiclesTable .. " SET `state` = @stored WHERE `plate` = @plate", {
|
|
||||||
["@plate"] = plate,
|
|
||||||
["@stored"] = 0
|
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue