Disable Ambulance,Firetrucks, Army, etc


#1

So, I have tried to disable Ambulances, Firetrucks, etc from responding to AI accidents, but something is obviously not working and I am trying to figure if I am making obvious mistake or the native is just not working.
I have tried following:

Citizen.CreateThread(function()
	while true do
		Wait(0)
		for i = 1, 15 do
			EnableDispatchService(i, false)
		end

	end
end)

And I have also tried to disable it separately…

Citizen.CreateThread(function()
	while true do
		Wait(0)
                EnableDispatchService(1, false)
                EnableDispatchService(2, false)
                EnableDispatchService(3, false)
                //etc
	end
end)

I am getting following in the console:

attempt to call a nil value (global ‘EnableDispatchService’)

Any ideas?


#2

It’s seems that the script is not recognising EnableDispatchService as a valid Native…
Try putting this into your __resource.lua:

resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'

And also, did you try to run this at client, right? If not then that’s the problem.


#3

I already have that manifest version declared and yes it was run in client file obviously.