[RELEASE] Disable ALL Emergency Service and Military Dispatching

is it possible to disable all NPC on a separate server?

If you want to disable all peds just search the releases section

you know a good script for remove ?

Yes, one second I will link

EDIT: [Release] Disable vehicles and peds

Any chance you could help me out i can get this to work

does this disable the police radio in police vehicles?

No, it simply disables the spawning of emergency and military vehicles.

Not working anymore.

Did everything as you said and they still dispatch and spawn the vehicles at police stations

v1.1.0 released! See original post.

This version worked perfectly for me in testing, so if you encounter any issues, please let me know.

1 Like

I know this is a little bit older post but you could you reverse this script to enable the npc police and swat and military and emergency vehicles? playing on a small small server with only few people and i like the aspect of having jobs with the ESX pack but still want NPC police due to the fact that we dont have many people to be police, I’ve disabled the police job and emergency response jobs but still dont have npc police.

I guess this doesnt prevent cops and other emergency npcs to spawn at for example the police stations?

1 Like

Tested and working on newer versions.

Server is spawning gang vehicles after I inserted this.

The script only disables military and police vehicles, not gang vehicles.

1 Like

Right but I didn’t have markers for gang vehicles before running this script. Which was kinda confusing.

Well, this script doesn’t add any markers, so this problem you’re having isn’t related to my script.

hy trie every way and still apears ambulance any ideas?

Is it only Dispatching or also the IA’s?

1 Like

For ambulance dispatch this should be all you need.

EnableDispatchService(5, false)

Also notice in this script it runs in an infinite loop which is not necessary, we only need to process this stuff once after the player is active in the session.

The client.lua could be updated to the below so it runs once to set, break the loop and let the thread end. Setting ACTIVE = true on any in dispatchTypes will enable them however as long as SetMaxWantedLevel(0) is in place the police will never still never dispatch. I use that instead of what is in the original script to stop the minimap from ever blinking red/blue and also like to leave the gangs and biker backup dispatch enabled.

local dispatchTypes =
{
	DT_PoliceAutomobile = { ID = 1, ACTIVE = false },
	DT_PoliceHelicopter = { ID = 2, ACTIVE = false },
	DT_FireDepartment = { ID = 3, ACTIVE = false },
	DT_SwatAutomobile = { ID = 4, ACTIVE = false },
	DT_AmbulanceDepartment = { ID = 5, ACTIVE = false },
	DT_PoliceRiders = { ID = 6, ACTIVE = false },
	DT_PoliceVehicleRequest = { ID = 7, ACTIVE = false },
	DT_PoliceRoadBlock = { ID = 8, ACTIVE = false},
	DT_PoliceAutomobileWaitPulledOver = { ID = 9, ACTIVE = false },
	DT_PoliceAutomobileWaitCruising = { ID = 10, ACTIVE = false },
	DT_Gangs = { ID = 11, ACTIVE = false },
	DT_SwatHelicopter = { ID = 12, ACTIVE = false },
	DT_PoliceBoat = { ID = 13, ACTIVE = false },
	DT_ArmyVehicle = { ID = 14, ACTIVE = false },
	DT_BikerBackup = { ID = 15, ACTIVE = false }
}

Citizen.CreateThread(function()
	while true do
		Wait(0)
		if NetworkIsPlayerActive(PlayerId()) then
			for k,v in pairs(dispatchTypes) do
				EnableDispatchService(dispatchTypes[k].ID, dispatchTypes[k].ACTIVE)
			end
			SetMaxWantedLevel(0)
			break;
		end
	end
end)
4 Likes

HI. I added this code as you suggested and I still got 3 cop cars and 1 ambulance turn up? Any ideas why? I just replaced all the original code and put this in its place.