This commit is contained in:
Miho931 2025-06-12 12:55:30 +02:00
parent f3a9f443a7
commit dd9754b106
2 changed files with 15 additions and 13 deletions

View file

@ -9,16 +9,18 @@ AddEventHandler('mh_garage:retrieveVehicle', function()
QBCore.Functions.TriggerCallback('mh_garage:CallVehicles', function(cb)
Debug(json.encode(cb))
for i = 1, #cb, 1 do
local mods = json.decode(cb[i].mods)
table.insert(opt, {
title = cb[i].name,
description = "Kennzeichen: "..cb[i].plate.."\nTankinhalt: "..math.round(mods.fuelLevel, 2).."%",
icon = "car",
onSelect = function()
cb[i].mods = mods
SpawnThisVehicle(cb[i])
end
})
if cb[i].garage ~= "OUT" then
local mods = json.decode(cb[i].mods)
table.insert(opt, {
title = cb[i].name,
description = "Kennzeichen: "..cb[i].plate.."\nTankinhalt: "..math.round(mods.fuelLevel, 2).."%",
icon = "car",
onSelect = function()
cb[i].mods = mods
SpawnThisVehicle(cb[i])
end
})
end
end
lib.registerContext({