Skip to content

Commit

Permalink
chore: npc control management
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Oct 2, 2024
1 parent 77044aa commit 9b396c3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions server-data/resources/[esx_addons]/esx_vehicleshop/client/npc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--Npc_control
CreateThread(function()
while true do
Wait(0) -- imposta 0 per prevenire il crash del server

-- These natives have to be called every frame.
SetVehicleDensityMultiplierThisFrame(0.1) -- traffic density
SetPedDensityMultiplierThisFrame(0.1) -- set npc/ai peds density to 0
SetRandomVehicleDensityMultiplierThisFrame(0.1) -- set random vehicles (car scenarios / cars driving off from a parking spot etc.) to 0
SetParkedVehicleDensityMultiplierThisFrame(0.1) -- set random parked vehicles (parked car scenarios) to 0
SetScenarioPedDensityMultiplierThisFrame(0.1, 0.1) -- set random npc/ai peds or scenario peds to 0
SetGarbageTrucks(true) -- Stop garbage trucks from randomly spawning
SetRandomBoats(false) -- Stop random boats from spawning in the water.
SetCreateRandomCops(false) -- disable random cops walking/driving around.
SetCreateRandomCopsNotOnScenarios(false) -- stop random cops (not in a scenario) from spawning.
SetCreateRandomCopsOnScenarios(false) -- stop random cops (in a scenario) from spawning.

local x,y,z = table.unpack(GetEntityCoords(PlayerPedId()))
ClearAreaOfVehicles(x, y, z, 1000, false, false, false, false, false)
RemoveVehiclesFromGeneratorsInArea(x - 500.0, y - 500.0, z - 500.0, x + 500.0, y + 500.0, z + 500.0);
end
end)

0 comments on commit 9b396c3

Please sign in to comment.