[GARAGE]
This commit is contained in:
parent
a29350c85f
commit
fa136ac8c4
6 changed files with 303 additions and 18 deletions
|
@ -1,3 +1,29 @@
|
|||
RegisterNetEvent('mh_garage:retrieveVehicle')
|
||||
AddEventHandler('mh_garage:retrieveVehicle', function()
|
||||
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, {
|
||||
title = cb[i].name
|
||||
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)
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue