forked from Simnation/Main
ed
This commit is contained in:
parent
6d22d5f77c
commit
63fbc60a00
86 changed files with 8352 additions and 3428 deletions
76
resources/[Developer]/mh_garage/client/verwaltung.lua
Normal file
76
resources/[Developer]/mh_garage/client/verwaltung.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
RegisterNetEvent('mh_garage:verwaltungVeh')
|
||||
AddEventHandler('mh_garage:verwaltungVeh', function()
|
||||
QBCore.TriggerCallback('mh_garage:verwaltung', function(cb)
|
||||
Debug("Verwaltung CB: "..json.encode(cb))
|
||||
if cb[1] ~= nil then
|
||||
local opt = {}
|
||||
|
||||
for i = 1, #cb, 1 do
|
||||
|
||||
local isingarage = cb[i].current_in_garage
|
||||
local des = ""
|
||||
|
||||
if isingarage then
|
||||
des = "Bearbeite das Fahrzeug\nKennzeichen: "..cb[i].current_plate.."\nGarage: "..cb[i].current_garage
|
||||
else
|
||||
des = "Bearbeite das Fahrzeug\nKennzeichen: "..cb[i].current_plate.."\nLetzte bekannte Garage: "..cb[i].current_garage
|
||||
end
|
||||
|
||||
table.insert(opt, {
|
||||
title = cb[i].current_name,
|
||||
description = des,
|
||||
icon = "car",
|
||||
onSelect = function()
|
||||
OpenVerwaltung(cb[i])
|
||||
end
|
||||
})
|
||||
end
|
||||
else
|
||||
lib.notify({
|
||||
title = "Fahrzeug Verwaltung",
|
||||
description = "Du bist nicht im Besitz eines Fahrzeuges!",
|
||||
type = "inform"
|
||||
})
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
function OpenVerwaltung(vehicleInfos)
|
||||
Debug("OpenVerwaltung: "..json.encode(vehicleInfos))
|
||||
local garages = {}
|
||||
for k, v in pairs(Config.Zonen) do
|
||||
table.insert(garages, v.name)
|
||||
end
|
||||
lib.registerMenu({
|
||||
id = 'some_menu_id',
|
||||
title = 'Menu title',
|
||||
position = 'top-right',
|
||||
onSideScroll = function(selected, scrollIndex, args)
|
||||
print("Scroll: ", selected, scrollIndex, args)
|
||||
end,
|
||||
onSelected = function(selected, secondary, args)
|
||||
if not secondary then
|
||||
print("Normal button")
|
||||
else
|
||||
if args.isCheck then
|
||||
print("Check button")
|
||||
end
|
||||
|
||||
if args.isScroll then
|
||||
print("Scroll button")
|
||||
end
|
||||
end
|
||||
print(selected, secondary, json.encode(args, {indent=true}))
|
||||
end,
|
||||
options = {
|
||||
{label = "Name ändern", icon = "paper"},
|
||||
{label = 'Transport to:', icon = 'arrows-up-down-left-right', values=garages},
|
||||
}
|
||||
}, function(selected, scrollIndex, args)
|
||||
print(selected, scrollIndex, args)
|
||||
end)
|
||||
|
||||
RegisterCommand('testmenu', function()
|
||||
lib.showMenu('some_menu_id')
|
||||
end)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue