Main/resources/[carscripts]/mh_garage/client/retrieve.lua

29 lines
871 B
Lua
Raw Normal View History

2025-06-08 16:20:16 +02:00
RegisterNetEvent('mh_garage:retrieveVehicle')
2025-06-09 13:28:19 +02:00
AddEventHandler('mh_garage:retrieveVehicle', function(zone)
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local random = SelectName()
local opt = {}
QBCore.Functions.TriggerCallback('mh_garage:CallVehicles', function(cb)
for i = 1, #cb, 1 do
table.insert(opt, {
2025-06-09 13:50:04 +02:00
title = cb[i].name,
2025-06-09 13:28:19 +02:00
description = "Kennzeichen: "..cb[i].plate.."\nTankinhalt: "..cb[i].mods.fuelLevel.."%",
icon = "car",
onSelect = function()
SpawnThisVehicle(cb[i])
end
})
end
lib.registerContext({
id = "retrieveVehicle",
title = random.name,
options = opt
})
lib.showContext("retrieveVehicle")
end, zone.name)
2025-06-08 16:20:16 +02:00
end)