forked from Simnation/Main
Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
This commit is contained in:
commit
ef00e4f084
4 changed files with 17 additions and 6 deletions
|
@ -124,7 +124,7 @@ function AddTargetOptions()
|
|||
{
|
||||
type = "client",
|
||||
event = "mh_garage:retrieveVehicle",
|
||||
icon = "fas fa-car",
|
||||
icon = "key",
|
||||
label = "Schlüssel Fahrzeug ausparken",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,14 @@ AddEventHandler('mh_garage:retrieveOwnerVehicle', function()
|
|||
end
|
||||
})
|
||||
end
|
||||
end)
|
||||
lib.registerContext({
|
||||
id = "retrieveVehicle",
|
||||
title = random.name,
|
||||
options = opt
|
||||
})
|
||||
|
||||
lib.showContext("retrieveVehicle")
|
||||
end, CurrentZone.name)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('mh_garage:retrieveVehicle')
|
||||
|
@ -36,7 +43,11 @@ AddEventHandler('mh_garage:retrieveVehicle', function()
|
|||
local opt = {}
|
||||
|
||||
QBCore.Functions.TriggerCallback('mh_garage:retrieveKeyVehicle', function(cb)
|
||||
Debug(json.encode(cb))
|
||||
if cb == false then
|
||||
Notification("Es ist kein Fahrzeug hier!", "inform")
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, #cb, 1 do
|
||||
if cb[i].garage ~= "OUT" then
|
||||
local mods = json.decode(cb[i].mods)
|
||||
|
|
|
@ -9,7 +9,7 @@ AddEventHandler('mh_garage:storeVehicle', function()
|
|||
for i = 1, #vehicles, 1 do
|
||||
local veh_coords = GetEntityCoords(vehicles[i])
|
||||
local distance = #(veh_coords - coords)
|
||||
if distance < 10.0 then
|
||||
if distance < 15.0 then
|
||||
local mods = QBCore.Functions.GetVehicleProperties(vehicles[i])
|
||||
local lc_fuelLevel = exports["lc_fuel"]:GetFuel(vehicles[i]) -- Get the fuel level
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ QBCore.Functions.CreateCallback('mh_garage:retrieveOwnerVehicle', function(sourc
|
|||
local pedid = Player.PlayerData.citizenid
|
||||
local veh = {}
|
||||
|
||||
MySQL.query("SELECT * FROM player_vehicles WHERE owner = ? and garage = ?", {pedid, zone}, function(rs)
|
||||
MySQL.query("SELECT * FROM player_vehicles WHERE citizenid = ? and garage = ?", {pedid, zone}, function(rs)
|
||||
if rs ~= nil and rs[1] ~= nil then
|
||||
for k, v in pairs (rs) do
|
||||
table.insert(veh, {
|
||||
|
@ -107,7 +107,7 @@ QBCore.Functions.CreateCallback('mh_garage:retrieveKeyVehicle', function(source,
|
|||
local pedid = Player.PlayerData.citizenid
|
||||
local veh = {}
|
||||
|
||||
MySQL.query("SELECT pv.* FROM player_vehicles pv JOIN vehicle_keys vk ON pv.plate = vk.plate WHERE vk.owner = ? AND vk.count > 0", {playerId}, function(vehicles)
|
||||
MySQL.query("SELECT pv.* FROM player_vehicles pv JOIN vehicle_keys vk ON pv.plate = vk.plate WHERE vk.owner = ? AND vk.count > 0 AND pv.garage = ?", {pedid, zone}, function(vehicles)
|
||||
if vehicles and #vehicles > 0 then
|
||||
for _, vehicle in pairs(vehicles) do
|
||||
table.insert(veh, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue