1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-07 13:54:41 +02:00
parent d5aace907a
commit 187f3ee8ff
2 changed files with 37 additions and 23 deletions

View file

@ -1,4 +1,4 @@
-- Generated with https://configurator.jgscripts.com at 8/7/2025, 10:59:08 AM -- Generated with https://configurator.jgscripts.com at 8/7/2025, 11:44:33 AM
Config = {} Config = {}
Config.Locale = 'de' Config.Locale = 'de'
@ -34,8 +34,8 @@ Config.EnableTransfers = {
betweenGarages = false, betweenGarages = false,
betweenPlayers = true, betweenPlayers = true,
} }
Config.AllowInfiniteVehicleSpawns = false Config.AllowInfiniteVehicleSpawns = true
Config.JobGaragesAllowInfiniteVehicleSpawns = false Config.JobGaragesAllowInfiniteVehicleSpawns = true
Config.GangGaragesAllowInfiniteVehicleSpawns = false Config.GangGaragesAllowInfiniteVehicleSpawns = false
Config.GarageVehicleReturnCost = 0 Config.GarageVehicleReturnCost = 0
Config.GarageVehicleReturnCostSocietyFund = false Config.GarageVehicleReturnCostSocietyFund = false

View file

@ -382,6 +382,12 @@ CreateThread(function()
if driver == playerPed and IsVehicleClassAllowed(currentVehicle) then if driver == playerPed and IsVehicleClassAllowed(currentVehicle) then
local plate = QBCore.Functions.GetPlate(currentVehicle) local plate = QBCore.Functions.GetPlate(currentVehicle)
-- Skip vehicles with empty or invalid plates
if not plate or plate == "" or string.len(plate) < 2 then
Debug("Skipping vehicle with invalid plate")
goto continue
end
-- Anti-Duplication: Check if this plate already exists multiple times -- Anti-Duplication: Check if this plate already exists multiple times
if DoesVehicleExistInWorld(plate) then if DoesVehicleExistInWorld(plate) then
Debug("Anti-Dupe: Detected duplicate vehicle with plate " .. plate .. ", not tracking") Debug("Anti-Dupe: Detected duplicate vehicle with plate " .. plate .. ", not tracking")
@ -390,7 +396,14 @@ CreateThread(function()
-- Check if this vehicle is already being tracked -- Check if this vehicle is already being tracked
if not trackedVehicles[plate] and not garagePending[plate] then if not trackedVehicles[plate] and not garagePending[plate] then
-- Track all vehicles, regardless of ownership -- First verify this vehicle exists in the database
TriggerServerEvent('antidespawn:server:checkVehicleExists', plate, function(exists)
if not exists then
Debug("Vehicle not in database, not tracking: " .. plate)
return
end
-- Track all vehicles that exist in the database
trackedVehicles[plate] = currentVehicle trackedVehicles[plate] = currentVehicle
-- Speichere letzte bekannte Position -- Speichere letzte bekannte Position
@ -410,6 +423,7 @@ CreateThread(function()
local vehicleModel = GetEntityModel(currentVehicle) local vehicleModel = GetEntityModel(currentVehicle)
TriggerServerEvent('antidespawn:server:registerVehicle', plate, vehicleModel, vehicleCoords, vehicleHeading, vehicleMods) TriggerServerEvent('antidespawn:server:registerVehicle', plate, vehicleModel, vehicleCoords, vehicleHeading, vehicleMods)
end)
end end
end end
end end