Jump to content

[HELP] Replacing police sirens with other siren


ville

Recommended Posts

Posted

Is there any way to replace police sirens wit hother sirens? I have mp3 files for the both siren, what i have to do now?

Check out my mta server :3, Freeroam, drifting, CnR, missions and much things to do

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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

Check out my mta server :3, Freeroam, drifting, CnR, missions and much things to do

560x95_FFFFFF_FF9900_000000_000000.png

Posted

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

Previously known as MrTasty.

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...