1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-06-24 23:32:29 +02:00
commit c81fa32afb
2 changed files with 6 additions and 3 deletions

View file

@ -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,

View file

@ -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