1
0
Fork 0
forked from Simnation/Main

Update stored.lua

This commit is contained in:
Miho931 2025-06-08 18:23:47 +02:00
parent 8ac6cde5d3
commit 02baea75f9

View file

@ -7,14 +7,11 @@ AddEventHandler('mh_garage:storeVehicle', function(zone)
local random = SelectName() local random = SelectName()
local opt = {} local opt = {}
print(json.encode(random))
for i = 1, #vehicles, 1 do for i = 1, #vehicles, 1 do
local veh_coords = GetEntityCoords(vehicles[i]) local veh_coords = GetEntityCoords(vehicles[i])
local distance = #(veh_coords - coords) local distance = #(veh_coords - coords)
print(distance)
if distance < 40.0 then if distance < 40.0 then
local mods = QBCore.Functions.GetVehicleProperties(vehicles[i]) local mods = QBCore.Functions.GetVehicleProperties(vehicles[i])
print("3")
table.insert(opt, { table.insert(opt, {
title = "Kennzeichen: "..mods.plate, title = "Kennzeichen: "..mods.plate,
description = "Soll dieses Fahrzeug eingeparkt werden?", description = "Soll dieses Fahrzeug eingeparkt werden?",
@ -35,14 +32,12 @@ print("3")
end end
end end
}) })
print("4")
lib.registerContext({ lib.registerContext({
id = "StoredVehicles", id = "StoredVehicles",
title = random.name, title = random.name,
description = random.description, description = random.description,
options = opt options = opt
}) })
print("5")
lib.showContext("StoredVehicles") lib.showContext("StoredVehicles")
end end
end end