ville Posted February 25, 2015 Share Posted February 25, 2015 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? Link to comment
Enargy, Posted February 25, 2015 Share Posted February 25, 2015 getElementPosition getPedOccupiedVehicle attachElementToElement triggerClientEvent getLocalPlayer playSound3D bindKey Link to comment
ville Posted February 25, 2015 Author Share Posted February 25, 2015 Mm maybe too hard for me :Dd Link to comment
JR10 Posted February 25, 2015 Share Posted February 25, 2015 Try something out first and then we can help you with your code. Check the community for examples. Link to comment
ville Posted February 26, 2015 Author Share Posted February 26, 2015 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
Enargy, Posted February 26, 2015 Share Posted February 26, 2015 the function called sirens use triggerClientEvent instead of setVehicleSirensOn and add in the clientside playSound3D and stopSound Link to comment
Addlibs Posted February 27, 2015 Share Posted February 27, 2015 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
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