Jump to content

[HELP] Replacing police sirens with other siren


ville

Recommended Posts

players = getElementsByType("player") 
  
addEventHandler("onResourceStart", resourceRoot, 
function() 
   for index,player in ipairs(players) do 
   bindKey(player, "M","down", sirens) 
   end 
end) 
  
function sirens(player) 
local veh = getPedOccupiedVehicle(player) 
    if (veh) then 
      addVehicleSirens(veh,1,1) 
        if not getVehicleSirensOn (veh) then 
            setVehicleSirensOn (veh, true) 
        else 
            setVehicleSirensOn (veh, false) 
            removeVehicleSirens(veh) 
        end 
    end 
end 

I dont know.. I have 2 siren files need to replace like first when u turn firens on and the other siren when u pressing siren button

Link to comment

Disable the original sounds with setWorldSoundEnabled and then make a client side check (setTimer or onClientRender in conjunction with getTickCount), if getVehicleSirensOn returns true, playSound3D. As soon as it stops returning true, stopSound or destroyElement

PS. This was already suggested (not in as much detail) in another topic - use the search first next time ;)viewtopic.php?f=91&t=85516

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...