I made a mistake in getVehicleByID(id).
function removePoliceSirens()
local policeCars = {523, 596, 597, 598, 599, 327}
for i, id in ipairs(policeCars) do
local vehicle = getElementByID("vehicle_" .. id)
if vehicle and getElementType(vehicle) == "vehicle" and getVehicleType(vehicle) == "Automobile" then
setVehicleSirensOn(vehicle, false)
addVehicleSirens(vehicle, 1, 2, true, false, true, true)
end
end
end
addEventHandler("onResourceStart", resourceRoot, removePoliceSirens)
Fixed it, but the result is the same.