forked from Simnation/Main
ed
This commit is contained in:
parent
d5aace907a
commit
187f3ee8ff
2 changed files with 37 additions and 23 deletions
|
@ -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.Locale = 'de'
|
||||
|
@ -34,8 +34,8 @@ Config.EnableTransfers = {
|
|||
betweenGarages = false,
|
||||
betweenPlayers = true,
|
||||
}
|
||||
Config.AllowInfiniteVehicleSpawns = false
|
||||
Config.JobGaragesAllowInfiniteVehicleSpawns = false
|
||||
Config.AllowInfiniteVehicleSpawns = true
|
||||
Config.JobGaragesAllowInfiniteVehicleSpawns = true
|
||||
Config.GangGaragesAllowInfiniteVehicleSpawns = false
|
||||
Config.GarageVehicleReturnCost = 0
|
||||
Config.GarageVehicleReturnCostSocietyFund = false
|
||||
|
|
|
@ -382,6 +382,12 @@ CreateThread(function()
|
|||
if driver == playerPed and IsVehicleClassAllowed(currentVehicle) then
|
||||
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
|
||||
if DoesVehicleExistInWorld(plate) then
|
||||
Debug("Anti-Dupe: Detected duplicate vehicle with plate " .. plate .. ", not tracking")
|
||||
|
@ -390,26 +396,34 @@ CreateThread(function()
|
|||
|
||||
-- Check if this vehicle is already being tracked
|
||||
if not trackedVehicles[plate] and not garagePending[plate] then
|
||||
-- Track all vehicles, regardless of ownership
|
||||
trackedVehicles[plate] = currentVehicle
|
||||
-- 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
|
||||
|
||||
-- Speichere letzte bekannte Position
|
||||
lastKnownCoords[plate] = GetEntityCoords(currentVehicle)
|
||||
-- Track all vehicles that exist in the database
|
||||
trackedVehicles[plate] = currentVehicle
|
||||
|
||||
-- Sofort starke Despawn-Verhinderung
|
||||
PreventDespawn(currentVehicle)
|
||||
-- Speichere letzte bekannte Position
|
||||
lastKnownCoords[plate] = GetEntityCoords(currentVehicle)
|
||||
|
||||
Debug("Fahrzeug wird nun getrackt: " .. plate)
|
||||
-- Sofort starke Despawn-Verhinderung
|
||||
PreventDespawn(currentVehicle)
|
||||
|
||||
-- Hole Fahrzeugmods
|
||||
local vehicleMods = GetVehicleMods(currentVehicle)
|
||||
Debug("Fahrzeug wird nun getrackt: " .. plate)
|
||||
|
||||
-- Registriere Fahrzeug beim Server
|
||||
local vehicleCoords = GetEntityCoords(currentVehicle)
|
||||
local vehicleHeading = GetEntityHeading(currentVehicle)
|
||||
local vehicleModel = GetEntityModel(currentVehicle)
|
||||
-- Hole Fahrzeugmods
|
||||
local vehicleMods = GetVehicleMods(currentVehicle)
|
||||
|
||||
TriggerServerEvent('antidespawn:server:registerVehicle', plate, vehicleModel, vehicleCoords, vehicleHeading, vehicleMods)
|
||||
-- Registriere Fahrzeug beim Server
|
||||
local vehicleCoords = GetEntityCoords(currentVehicle)
|
||||
local vehicleHeading = GetEntityHeading(currentVehicle)
|
||||
local vehicleModel = GetEntityModel(currentVehicle)
|
||||
|
||||
TriggerServerEvent('antidespawn:server:registerVehicle', plate, vehicleModel, vehicleCoords, vehicleHeading, vehicleMods)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue