Disable all NPCs dont work // And possible to turn animals on?

Hello guys :slight_smile:

I have a question please. We would like to disable all NPCs and we use this code from here: [Release] Disable vehicles and peds from Ekrema. But a few NPCs will still spawn on the street (in vehicles), anyone have a idea?

Citizen.CreateThread(function()
    while true 
    	do
    		-- These natives has to be called every frame.
    		SetVehicleDensityMultiplierThisFrame(0.0)
		SetPedDensityMultiplierThisFrame(0.0)
		SetRandomVehicleDensityMultiplierThisFrame(0.0)
		SetParkedVehicleDensityMultiplierThisFrame(0.0)
		SetScenarioPedDensityMultiplierThisFrame(0.0, 0.0)
		
		local playerPed = GetPlayerPed(-1)
		local pos = GetEntityCoords(playerPed) 
		RemoveVehiclesFromGeneratorsInArea(pos['x'] - 500.0, pos['y'] - 500.0, pos['z'] - 500.0, pos['x'] + 500.0, pos['y'] + 500.0, pos['z'] + 500.0);
		
		
		-- These natives do not have to be called everyframe.
		SetGarbageTrucks(0)
		SetRandomBoats(0)
    	
		Citizen.Wait(1)
	end

end)

Its possible to disable all NPCs and maybe to activate animals?

Thanks in advance :smiley:

1 Like

same problem
try this maby it work’s

npc_control was the first script i tested, but the same problem :confused:

1 Like

tested this with zap-hosting give you some shot’s hot to add ^^

you need to let it named to npc_control and put the whole folder into resources folder from your server.

next you go to server.cfg and add the line start npc_control
when you using dunkos vrp you must look for ##end of vrp##

haha thank you, i know how add new ressources :stuck_out_tongue: but i test this script now again and tell here again the result

1 Like

so i test this script again, same problem… i can see again a few vehicles sometimes :confused:

i dont know, anybody have a idea?

Should be:

while true do

Should not be indented three times.

How do I put some NPCs? I put a little density and it will not

Citizen.CreateThread(function()
    while true do
		SetVehicleDensityMultiplierThisFrame(0.0)
		SetRandomVehicleDensityMultiplierThisFrame(0.0)
		SetParkedVehicleDensityMultiplierThisFrame(0.0)
	
		SetPedDensityMultiplierThisFrame(0.0)
        SetScenarioPedDensityMultiplierThisFrame(0.0, 0.0)
        		
		SetGarbageTrucks(false)
		SetRandomBoats(false)
		SetRandomTrains(false)
		Citizen.Wait(0)
    end
end)

my problem is i almost have no npcs pls help

1 Like

i need the same thing. i need all npcs off but animals on. its possible ?