forked from Simnation/Main
resources/[jobs]/[civ]/mh_jobgarage/client/chiefsettings.lua aktualisiert
This commit is contained in:
parent
94e5ce7ac3
commit
bb8090d08c
1 changed files with 202 additions and 201 deletions
|
@ -37,56 +37,57 @@ function OpenChiefMenu(vehicles)
|
|||
end
|
||||
|
||||
function OpenChiefAddVehicleMenu()
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
local Player = QBCore.Functions.GetPlayerData()
|
||||
local vehicles = GetGamePool('CVehicle')
|
||||
local opt = {}
|
||||
|
||||
for i = 1, #vehicles, 1 do
|
||||
local vehicleCoords = GetEntityCoords(vehicles[i])
|
||||
local distance = #(vehicleCoords - coords)
|
||||
QBCore.Functions.TriggerCallback('mh_jobgarage:CallOwnerVehicles', function(vehicles)
|
||||
if vehicles ~= false then
|
||||
local opt = {}
|
||||
|
||||
if distance < 20.0 then
|
||||
local mods = QBCore.Functions.GetVehicleProperties(vehicles[i])
|
||||
print(json.encode(mods))
|
||||
table.insert(opt, {
|
||||
title = "Kennzeichen: "..mods.plate,
|
||||
description = "Dieses Fahrzeug Hinzufügen?",
|
||||
icon = "car",
|
||||
onSelect = function()
|
||||
local value = lib.inputDialog("Schlüsselkasten", {
|
||||
{type = "input", label = "Anzeigename", description = "Anzeigename wie die anderen den sehen!"},
|
||||
{type = "number", label = "Schlüsselanzahl", description = "Anzahl der Ersatzschlüssel."},
|
||||
{type = "number", label = "Rang", description = "Ab welchen Rang darf man das Fahrzeug Fahren?"}
|
||||
})
|
||||
for i = 1, #vehicles, 1 do
|
||||
local isSpawned, mods = IsVehicleSpawned(plate)
|
||||
|
||||
QBCore.Functions.TriggerCallback('mh_jobgarage:AddVehicleToJob', function(cb)
|
||||
if cb.status then
|
||||
Notification("Schlüsselkasten", cb.text, cb.type)
|
||||
lib.hideContext('ChiefAddVehicleMenu')
|
||||
QBCore.Functions.TriggerCallback('mh_jobgarage:CallVehiclesInfo', function(cb)
|
||||
OpenMenu(cb)
|
||||
end, Player.job.name)
|
||||
else
|
||||
Notification("Schlüsselkasten", cb.text, cb.type)
|
||||
if cb.key then
|
||||
SetNewWaypoint(Config.KeyMaker.x, Config.KeyMaker.y)
|
||||
table.insert(opt, {
|
||||
title = "Kennzeichen: "..mods.plate,
|
||||
description = "Deine Ersatzschlüssel: "..vehicles[i].keys,
|
||||
icon = 'car',
|
||||
onSelect = function()
|
||||
local value = lib.inputDialog("Schlüsselkasten", {
|
||||
{type = "input", label = "Anzeigename", description = "Anzeigename wie die anderen den sehen!"},
|
||||
{type = "number", label = "Schlüsselanzahl", description = "Anzahl der Ersatzschlüssel.", min = 1, max = vehicles[i].keys},
|
||||
{type = "number", label = "Rang", description = "Ab welchen Rang darf man das Fahrzeug Fahren?"}
|
||||
})
|
||||
|
||||
QBCore.Functions.TriggerCallback('mh_jobgarage:AddVehicleToJob', function(cb)
|
||||
if cb.status then
|
||||
Notification("Schlüsselkasten", cb.text, cb.type)
|
||||
lib.hideContext('ChiefAddVehicleMenu')
|
||||
QBCore.Functions.TriggerCallback('mh_jobgarage:CallVehiclesInfo', function(cb)
|
||||
OpenMenu(cb)
|
||||
end, Player.job.name)
|
||||
else
|
||||
Notification("Schlüsselkasten", cb.text, cb.type)
|
||||
if cb.key then
|
||||
SetNewWaypoint(Config.KeyMaker.x, Config.KeyMaker.y)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, mods.plate, value)
|
||||
end
|
||||
})
|
||||
end, mods.plate, value)
|
||||
end
|
||||
})
|
||||
|
||||
lib.registerContext({
|
||||
id = "ChiefAddVehicleMenu",
|
||||
title = "Schlüsselkasten",
|
||||
description = "Füge ein Fahrzeug hinzu.",
|
||||
options = opt
|
||||
})
|
||||
lib.registerContext({
|
||||
id = "ChiefAddVehicleMenu",
|
||||
title = "Schlüsselkasten",
|
||||
description = "Füge ein Fahrzeug hinzu.",
|
||||
options = opt
|
||||
})
|
||||
|
||||
lib.showContext("ChiefAddVehicleMenu")
|
||||
lib.showContext("ChiefAddVehicleMenu")
|
||||
end
|
||||
else
|
||||
Notification("Schlüsselkasten", "Keine Fahrzeuge von dir Gefunden!", "error")
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenChiefEditVehicleMenu(veh)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue