forked from Simnation/Main
Update client.lua
This commit is contained in:
parent
60c2087a00
commit
282085e6fc
1 changed files with 44 additions and 18 deletions
|
@ -7,12 +7,18 @@ end)
|
|||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
-- Nur normale Zivilisten und Autos erhalten
|
||||
SetPedDensityMultiplierThisFrame(0.7)
|
||||
SetScenarioPedDensityMultiplierThisFrame(0.7, 0.7)
|
||||
SetVehicleDensityMultiplierThisFrame(0.1)
|
||||
SetRandomVehicleDensityMultiplierThisFrame(0.1)
|
||||
SetParkedVehicleDensityMultiplierThisFrame(0.0)
|
||||
-- Stark reduzierte Fahrzeug- und Fußgängerdichte
|
||||
SetPedDensityMultiplierThisFrame(0.5) -- Von 0.7 auf 0.5 reduziert
|
||||
SetScenarioPedDensityMultiplierThisFrame(0.5, 0.5) -- Von 0.7 auf 0.5 reduziert
|
||||
|
||||
-- Verkehrsdichte auf Minimum setzen
|
||||
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
|
||||
SetPlayerWantedLevel(PlayerId(), 0, false)
|
||||
|
@ -26,6 +32,11 @@ CreateThread(function()
|
|||
|
||||
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")
|
||||
for _, ped in ipairs(peds) do
|
||||
if DoesEntityExist(ped) and not IsPedAPlayer(ped) then
|
||||
|
@ -33,16 +44,6 @@ CreateThread(function()
|
|||
if IsPedInAnyVehicle(ped, false) then
|
||||
local veh = GetVehiclePedIsIn(ped, false)
|
||||
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
|
||||
if vehModel == GetHashKey(v) then
|
||||
|
@ -54,6 +55,31 @@ CreateThread(function()
|
|||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue