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 = {}
|
||||||
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
|
||||||
|
|
|
@ -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,26 +396,34 @@ 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
|
||||||
trackedVehicles[plate] = currentVehicle
|
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
|
-- Track all vehicles that exist in the database
|
||||||
lastKnownCoords[plate] = GetEntityCoords(currentVehicle)
|
trackedVehicles[plate] = currentVehicle
|
||||||
|
|
||||||
-- Sofort starke Despawn-Verhinderung
|
-- Speichere letzte bekannte Position
|
||||||
PreventDespawn(currentVehicle)
|
lastKnownCoords[plate] = GetEntityCoords(currentVehicle)
|
||||||
|
|
||||||
Debug("Fahrzeug wird nun getrackt: " .. plate)
|
-- Sofort starke Despawn-Verhinderung
|
||||||
|
PreventDespawn(currentVehicle)
|
||||||
|
|
||||||
-- Hole Fahrzeugmods
|
Debug("Fahrzeug wird nun getrackt: " .. plate)
|
||||||
local vehicleMods = GetVehicleMods(currentVehicle)
|
|
||||||
|
|
||||||
-- Registriere Fahrzeug beim Server
|
-- Hole Fahrzeugmods
|
||||||
local vehicleCoords = GetEntityCoords(currentVehicle)
|
local vehicleMods = GetVehicleMods(currentVehicle)
|
||||||
local vehicleHeading = GetEntityHeading(currentVehicle)
|
|
||||||
local vehicleModel = GetEntityModel(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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue