From 15bed7d09ffba9673c84843347edbc8fa91de99f Mon Sep 17 00:00:00 2001 From: Miho Date: Tue, 24 Jun 2025 23:38:24 +0200 Subject: [PATCH] resources/[jobs]/[civ]/mh_jobgarage/client/chiefsettings.lua aktualisiert --- .../mh_jobgarage/client/chiefsettings.lua | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/resources/[jobs]/[civ]/mh_jobgarage/client/chiefsettings.lua b/resources/[jobs]/[civ]/mh_jobgarage/client/chiefsettings.lua index 3db7e0f4f..b3607b664 100644 --- a/resources/[jobs]/[civ]/mh_jobgarage/client/chiefsettings.lua +++ b/resources/[jobs]/[civ]/mh_jobgarage/client/chiefsettings.lua @@ -36,6 +36,26 @@ function OpenChiefMenu(vehicles) lib.showContext("ChiefSettingsMenu") end + +function IsVehicleSpawned(plate) + + local vehicles = GetGamePool('CVehicle') + + for _, vehicle in ipairs(vehicles) do + if DoesEntityExist(vehicle) then + local mods = QBCore.Functions.GetVehicleProperties(vehicle) + local vehiclePlate = mods.plate + + if vehiclePlate == plate then + print("Function: "..mods) + return true, mods + end + end + end + + return false, nil -- Vehicle not found +end + function OpenChiefAddVehicleMenu() local Player = QBCore.Functions.GetPlayerData() local opt = {}