Grimaexreaper Posted October 7, 2011 Posted October 7, 2011 is there any way to replace the custom gun sounds and replace them with ones that i have ?
0 Benevolence Posted October 7, 2011 Posted October 7, 2011 Yes Jason. It's client side, I will copy paste my semi-messy but working script. Don't forget to load the gun sound file (for example sniper.wav) in Meta. Ignore the commented stuff, all it does is make you go into slow motion when you shoot someone. It also blows up vehicles, I'm sure you know what res fiddycal is. function firedFiddyCal(weapon, ammo, clipammo, x, y, z, element) if ( weapon == 34) then -- sniper local px, py, pz = getElementPosition(source) local sound = playSound3D("sniper.wav", px, py, pz) setSoundMaxDistance(sound, 150) --if ( element and source == getLocalPlayer() and ( getElementType(element) == "vehicle" or getElementType(element) == "player" ) ) then -- we are the shooter --setGameSpeed(0.3) --setTimer(setGameSpeed, 6000, 1, 1.0) --triggerServerEvent("50cal", getLocalPlayer(), element) --end if ( element and getElementType(element) == "player" ) then -- make blood fxAddBlood(x, y, z, 0, 0, 1, 1000, 1) fxAddBlood(x, y, z, 1, 0, 0, 1000, 1) fxAddBlood(x, y, z, 0, 1, 1, 1000, 1) fxAddBlood(x, y, z, 1, 1, 1, 1000, 1) fxAddBlood(x, y, z, 0, 1, 0, 1000, 1) end end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), firedFiddyCal)
0 diegofkda Posted October 8, 2011 Posted October 8, 2011 There's a serious sound problem with that, when the sound stops, the sound doesn't get destroyed, so if you fire with the sniper 100 times in the area, go away from the area and go back, you will lag as hell.
0 Benevolence Posted October 8, 2011 Posted October 8, 2011 There's a serious sound problem with that, when the sound stops, the sound doesn't get destroyed, so if you fire with the sniper 100 times in the area, go away from the area and go back, you will lag as hell. Could you fix the script then?
0 Benevolence Posted October 8, 2011 Posted October 8, 2011 That's a bit hard to do for me Well what's the function I need to use?
0 diegofkda Posted October 8, 2011 Posted October 8, 2011 destroyElement for destroy the sound completely.
0 Grimaexreaper Posted October 10, 2011 Author Posted October 10, 2011 alright got mine custom gun shot sounds in and with no lag i fixed that part thanks for the info maybe next i'll se about car sounds
0 AGENT_STEELMEAT Posted October 11, 2011 Posted October 11, 2011 local function firedFiddyCal(weapon, ammo, clipammo, x, y, z, element) if ( weapon == 34) then -- sniper local px, py, pz = getElementPosition(source) local sound = playSound3D("sniper.wav", px, py, pz) setSoundMaxDistance(sound, 150) setTimer(destroyElement, 3000, 1, sound) if ( element and getElementType(element) == "player" ) then -- make blood fxAddBlood(x, y, z, 0, 0, 1, 1000, 1) fxAddBlood(x, y, z, 1, 0, 0, 1000, 1) fxAddBlood(x, y, z, 0, 1, 1, 1000, 1) fxAddBlood(x, y, z, 1, 1, 1, 1000, 1) fxAddBlood(x, y, z, 0, 1, 0, 1000, 1) end end end addEventHandler("onClientPlayerWeaponFire", root, firedFiddyCal) That's probably as efficient as it needs to be - a call to destroyElement is made 3 seconds after the shot is fired. Assuming that the sound is less than 3 seconds long, that should be enough.
0 diegofkda Posted October 11, 2011 Posted October 11, 2011 I've already tried custom car sounds and that's almost impossible excepting if you make a heavy resource for that , there was a feature suggested on bug tracker but seemed like the MTA team didn't take it as a possible feature...
0 Grimaexreaper Posted November 6, 2011 Author Posted November 6, 2011 well we can always do the ghetto way and add it in our rockstar ourselfs and hear it and tell or show our friends how to do the same lol thanks for the info tho yall
Question
Grimaexreaper
is there any way to replace the custom gun sounds and replace them with ones that i have ?
11 answers to this question
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