1
0
Fork 0
forked from Simnation/Main

Update client.lua

This commit is contained in:
Nordi98 2025-06-29 11:16:50 +02:00
parent 60c2087a00
commit 282085e6fc

View file

@ -7,13 +7,19 @@ end)
CreateThread(function() CreateThread(function()
while true do while true do
-- Nur normale Zivilisten und Autos erhalten -- Stark reduzierte Fahrzeug- und Fußgängerdichte
SetPedDensityMultiplierThisFrame(0.7) SetPedDensityMultiplierThisFrame(0.5) -- Von 0.7 auf 0.5 reduziert
SetScenarioPedDensityMultiplierThisFrame(0.7, 0.7) SetScenarioPedDensityMultiplierThisFrame(0.5, 0.5) -- Von 0.7 auf 0.5 reduziert
SetVehicleDensityMultiplierThisFrame(0.1)
SetRandomVehicleDensityMultiplierThisFrame(0.1) -- Verkehrsdichte auf Minimum setzen
SetParkedVehicleDensityMultiplierThisFrame(0.0) SetVehicleDensityMultiplierThisFrame(0.01) -- Von 0.1 auf 0.01 reduziert
SetRandomVehicleDensityMultiplierThisFrame(0.01) -- Von 0.1 auf 0.01 reduziert
SetParkedVehicleDensityMultiplierThisFrame(0.0) -- Bleibt bei 0.0
-- Zusätzliche Verkehrskontrollen
SetSomeCarDensityMultiplierThisFrame(0.01) -- Neu hinzugefügt
SetParkedCarDensityPercentage(0.0) -- Neu hinzugefügt
-- Kein Wanted-Level / Polizei-Eingriffe -- Kein Wanted-Level / Polizei-Eingriffe
SetPlayerWantedLevel(PlayerId(), 0, false) SetPlayerWantedLevel(PlayerId(), 0, false)
ClearPlayerWantedLevel(PlayerId()) ClearPlayerWantedLevel(PlayerId())
@ -25,6 +31,11 @@ CreateThread(function()
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
ClearAreaOfCops(coords.x, coords.y, coords.z, 1000.0) ClearAreaOfCops(coords.x, coords.y, coords.z, 1000.0)
-- Periodisch Fahrzeuge in der Umgebung entfernen (alle ~10 Sekunden)
if math.random(1, 100) <= 10 then
ClearAreaOfVehicles(coords.x, coords.y, coords.z, 200.0, false, false, false, false, false)
end
local peds = GetGamePool("CPed") local peds = GetGamePool("CPed")
for _, ped in ipairs(peds) do for _, ped in ipairs(peds) do
@ -33,16 +44,6 @@ CreateThread(function()
if IsPedInAnyVehicle(ped, false) then if IsPedInAnyVehicle(ped, false) then
local veh = GetVehiclePedIsIn(ped, false) local veh = GetVehiclePedIsIn(ped, false)
local vehModel = GetEntityModel(veh) local vehModel = GetEntityModel(veh)
--[[ if vehModel == GetHashKey("ambulance") or
vehModel == GetHashKey("police") or
vehModel == GetHashKey("police2") or
vehModel == GetHashKey("sheriff") or
vehModel == GetHashKey("sheriff2") or
vehModel == GetHashKey("firetruk") or
vehModel == GetHashKey("towtruck") then
DeleteEntity(veh)
DeleteEntity(ped)
end ]]
for k, v in pairs(Config.vehModels) do for k, v in pairs(Config.vehModels) do
if vehModel == GetHashKey(v) then if vehModel == GetHashKey(v) then
@ -54,6 +55,31 @@ CreateThread(function()
end end
end end
Wait(500) Wait(100) -- Von 500ms auf 100ms reduziert für häufigere Updates
end
end)
-- Neuer Thread speziell für Verkehrsmanagement
CreateThread(function()
while true do
-- Zusätzliche Verkehrsbereinigung in größeren Intervallen
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
-- Entferne Fahrzeuge, die zu weit entfernt sind
local vehicles = GetGamePool("CVehicle")
for _, vehicle in ipairs(vehicles) do
if DoesEntityExist(vehicle) and not IsPedAPlayer(GetPedInVehicleSeat(vehicle, -1)) then
local vehCoords = GetEntityCoords(vehicle)
local distance = #(coords - vehCoords)
-- Fahrzeuge löschen, die weiter als 150 Einheiten entfernt sind
if distance > 150.0 then
DeleteEntity(vehicle)
end
end
end
Wait(5000) -- Alle 5 Sekunden prüfen
end end
end) end)