Lenz Posted May 4, 2023 Posted May 4, 2023 function removePoliceSirens() local policeCars = {523, 596, 597, 598, 599, 327} for i, id in ipairs(policeCars) do local vehicle = getVehicleByID(id) if vehicle then removeVehicleSirens(vehicle) addVehicleSirens(vehicle, 2, 1, false, false, false, true) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), removePoliceSirens) That's the first thing that popped into my head. But it didn't help. I need to completely remove the sound of the standard GTA siren. Since I'm using the custom one.
eoL Shady Posted May 4, 2023 Posted May 4, 2023 8 minutes ago, Lenz said: function removePoliceSirens() local policeCars = {523, 596, 597, 598, 599, 327} for i, id in ipairs(policeCars) do local vehicle = getVehicleByID(id) if vehicle then removeVehicleSirens(vehicle) addVehicleSirens(vehicle, 2, 1, false, false, false, true) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), removePoliceSirens) That's the first thing that popped into my head. But it didn't help. I need to completely remove the sound of the standard GTA siren. Since I'm using the custom one. Hello @Lenz function removePoliceSirens() local policeCars = {523, 596, 597, 598, 599, 327} for i, id in ipairs(policeCars) do local vehicle = getVehicleByID(id) if vehicle and getVehicleType(vehicle) == "Automobile" then setVehicleSirensOn(vehicle, false) addVehicleSirens(vehicle, 1, 2, true, false, true, false) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), removePoliceSirens)
Lenz Posted May 4, 2023 Author Posted May 4, 2023 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.
FLUSHBICEPS Posted May 5, 2023 Posted May 5, 2023 function removePoliceSirens() local policeCars = getElementsByType("vehicle", root) for i, vehicle in ipairs(policeCars) do local model = getElementModel(vehicle) if model == 523 or model == 596 or model == 597 or model == 598 or model == 599 or model == 327 then setVehicleSirensOn(vehicle, false) -- addVehicleSirens(vehicle, 1, 2, true, false, true, true) end end end addEventHandler("onResourceStart", resourceRoot, removePoliceSirens) Try this one Ive removed addVehicleSirens line
Lenz Posted May 5, 2023 Author Posted May 5, 2023 That's still not what it's all about. It should be removed or made quiet. (This is what sirenEdit does.) https://imgur.com/J14RQ1a
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now