forked from Simnation/Main
Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
This commit is contained in:
commit
c81fa32afb
2 changed files with 6 additions and 3 deletions
|
@ -48,6 +48,10 @@ function OpenChiefAddVehicleMenu()
|
||||||
|
|
||||||
for i = 1, #vehicles, 1 do
|
for i = 1, #vehicles, 1 do
|
||||||
local isSpawned, mods = IsVehicleSpawned(plate)
|
local isSpawned, mods = IsVehicleSpawned(plate)
|
||||||
|
while not isSpawned do
|
||||||
|
Wait(100)
|
||||||
|
end
|
||||||
|
print("Chiefsettings: "..mods)
|
||||||
|
|
||||||
table.insert(opt, {
|
table.insert(opt, {
|
||||||
title = "Kennzeichen: "..mods.plate,
|
title = "Kennzeichen: "..mods.plate,
|
||||||
|
|
|
@ -30,17 +30,16 @@ AddEventHandler('mh_jobgarage:notify', function(title, text, type)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function IsVehicleSpawned(plate)
|
function IsVehicleSpawned(plate)
|
||||||
plate = string.gsub(string.upper(plate), '^%s*(.-)%s*$', '%1'):gsub(' ', '')
|
|
||||||
|
|
||||||
local vehicles = GetGamePool('CVehicle')
|
local vehicles = GetGamePool('CVehicle')
|
||||||
|
|
||||||
for _, vehicle in ipairs(vehicles) do
|
for _, vehicle in ipairs(vehicles) do
|
||||||
if DoesEntityExist(vehicle) then
|
if DoesEntityExist(vehicle) then
|
||||||
local vehiclePlate = QBCore.Functions.GetPlate(vehicle)
|
|
||||||
local mods = QBCore.Functions.GetVehicleProperties(vehicle)
|
local mods = QBCore.Functions.GetVehicleProperties(vehicle)
|
||||||
vehiclePlate = string.gsub(string.upper(vehiclePlate), '^%s*(.-)%s*$', '%1'):gsub(' ', '')
|
local vehiclePlate = mods.plate
|
||||||
|
|
||||||
if vehiclePlate == plate then
|
if vehiclePlate == plate then
|
||||||
|
print("Function: "..mods)
|
||||||
return true, mods
|
return true, mods
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue