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,26 +37,24 @@ function OpenChiefMenu(vehicles)
|
||||||
end
|
end
|
||||||
|
|
||||||
function OpenChiefAddVehicleMenu()
|
function OpenChiefAddVehicleMenu()
|
||||||
local coords = GetEntityCoords(PlayerPedId())
|
|
||||||
local Player = QBCore.Functions.GetPlayerData()
|
local Player = QBCore.Functions.GetPlayerData()
|
||||||
local vehicles = GetGamePool('CVehicle')
|
local opt = {}
|
||||||
|
|
||||||
|
QBCore.Functions.TriggerCallback('mh_jobgarage:CallOwnerVehicles', function(vehicles)
|
||||||
|
if vehicles ~= false then
|
||||||
local opt = {}
|
local opt = {}
|
||||||
|
|
||||||
for i = 1, #vehicles, 1 do
|
for i = 1, #vehicles, 1 do
|
||||||
local vehicleCoords = GetEntityCoords(vehicles[i])
|
local isSpawned, mods = IsVehicleSpawned(plate)
|
||||||
local distance = #(vehicleCoords - coords)
|
|
||||||
|
|
||||||
if distance < 20.0 then
|
|
||||||
local mods = QBCore.Functions.GetVehicleProperties(vehicles[i])
|
|
||||||
print(json.encode(mods))
|
|
||||||
table.insert(opt, {
|
table.insert(opt, {
|
||||||
title = "Kennzeichen: "..mods.plate,
|
title = "Kennzeichen: "..mods.plate,
|
||||||
description = "Dieses Fahrzeug Hinzufügen?",
|
description = "Deine Ersatzschlüssel: "..vehicles[i].keys,
|
||||||
icon = "car",
|
icon = 'car',
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
local value = lib.inputDialog("Schlüsselkasten", {
|
local value = lib.inputDialog("Schlüsselkasten", {
|
||||||
{type = "input", label = "Anzeigename", description = "Anzeigename wie die anderen den sehen!"},
|
{type = "input", label = "Anzeigename", description = "Anzeigename wie die anderen den sehen!"},
|
||||||
{type = "number", label = "Schlüsselanzahl", description = "Anzahl der Ersatzschlüssel."},
|
{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?"}
|
{type = "number", label = "Rang", description = "Ab welchen Rang darf man das Fahrzeug Fahren?"}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -86,7 +84,10 @@ function OpenChiefAddVehicleMenu()
|
||||||
|
|
||||||
lib.showContext("ChiefAddVehicleMenu")
|
lib.showContext("ChiefAddVehicleMenu")
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
Notification("Schlüsselkasten", "Keine Fahrzeuge von dir Gefunden!", "error")
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function OpenChiefEditVehicleMenu(veh)
|
function OpenChiefEditVehicleMenu(veh)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue