marty000123 Posted December 10, 2016 Share Posted December 10, 2016 Hello, I use custom gun sounds but I hear the custom sounds mixed with the original, can't find out a way to disable the original. I know it's possible because I've seen it on other servers, but is it a hard thing to do? It's pretty annoying my ears. Thanks 4 the help Marty Link to comment
iPrestege Posted December 10, 2016 Share Posted December 10, 2016 Hi Marty ;p. You can use : setWorldSoundEnabled . And no it's not that hard. Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 Got it, thanks!! Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 I used the example given in the link and converted it from command to event. It works, but literally every weapon-related sound disappears, for example RPG firing, and reloading. How do I only disable the gun sounds of for example gun id 24? Link to comment
pa3ck Posted December 10, 2016 Share Posted December 10, 2016 "This function allows you to disable world sounds. A world sound is a sound effect which has not been caused by playSound or playSound3D. Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 18 minutes ago, pa3ck said: "This function allows you to disable world sounds. A world sound is a sound effect which has not been caused by playSound or playSound3D. Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki Doesn't really make me any wiser.. Link to comment
pa3ck Posted December 10, 2016 Share Posted December 10, 2016 Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki -> This explains how to get the group and index of a sound. When using setWorldSoundEnabled, there are 3 parameters, one of which is optional. As far as I know the "group" for the weapons is 5. To turn off ALL weapon sounds, you used setWorldSoundEnabled ( 5, false ) But, if you want to only disable specific weapon sounds, you should also pass the function that optional argument, which is the "index" setWorldSoundEnabled ( 5, 22, false ) If you read the 1st line of this post, you will then also understand how to find these ID's. Good luck. Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 I don't understand, what does the 22 stand for? Link to comment
koragg Posted December 10, 2016 Share Posted December 10, 2016 9 minutes ago, marty000123 said: I don't understand, what does the 22 stand for? OptionalArguments index : An integer representing an individual sound within the group Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 4 minutes ago, koragg said: OptionalArguments index : An integer representing an individual sound within the group Is there like a list or something where I can see the groups/indexs?? Link to comment
koragg Posted December 10, 2016 Share Posted December 10, 2016 4 minutes ago, marty000123 said: Is there like a list or something where I can see the groups/indexs?? Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode Link to comment
pa3ck Posted December 10, 2016 Share Posted December 10, 2016 You just asked 2 questions that I answered in my post. Read my post again, if you need use Google Translator as well. I will quote it again (for the 3rd time) Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 I've figured out how to do it, but it shows everything EXCEPT the gun firing, which is exactly what I need. So this isn't really usefull at all. Link to comment
pa3ck Posted December 10, 2016 Share Posted December 10, 2016 Stupid question, but are the weapon sounds disabled while using showsound? Link to comment
marty000123 Posted December 10, 2016 Author Share Posted December 10, 2016 (edited) 18 minutes ago, pa3ck said: Stupid question, but are the weapon sounds disabled while using showsound? I am officially retarded. I forgot to turn the sounds back on while checking. I'm on it now EDIT: Alright the /showsound works (I'm sorry for repeating the same question but I really didn't get it lol) but when I put the index there, it does the exact opposite. When I change setWorldSoundEnabled ( 5, enabled ) to setWorldSoundEnabled ( 5, 31, enabled ), it still gives every sound EXCEPT that one. While it should be the opposite, it should give that sound except the rest. This is my code: function toggleWeaponSounds_f ( ) local enabled = isWorldSoundEnabled ( 5 ) -- We place this variable here for checking. enabled = not enabled -- And here we invert (toggle) the variable, so if it's false, it becomes true, if it's true, it becomes false. -- Used for the chat declaration: local state = "enabled" if ( not enabled ) then state = "disabled" end -- setWorldSoundEnabled ( 5, 31, enabled ) -- And here the toggling happens. outputChatBox ( "Weapon sounds " .. state ) end addCommandHandler ( "toggleweaponsounds", toggleWeaponSounds_f ) Edited December 10, 2016 by marty000123 Link to comment
marty000123 Posted December 14, 2016 Author Share Posted December 14, 2016 On 12-12-2016 at 10:04 AM, marty000123 said: Bump Link to comment
pa3ck Posted December 14, 2016 Share Posted December 14, 2016 Please don't bump your post, this is not a trading website, somebody will help you if / when they can. What do you exactly want? Explain it a bit better, that's probably the reason why nobody was able to help you so far. 1 Link to comment
marty000123 Posted December 15, 2016 Author Share Posted December 15, 2016 On 14-12-2016 at 6:47 PM, pa3ck said: Please don't bump your post, this is not a trading website, somebody will help you if / when they can. What do you exactly want? Explain it a bit better, that's probably the reason why nobody was able to help you so far. Sorry about that, but I was really desperate. To make it more clear: the last script I posted only disables the original sounds. For instance, when I put 5,13 there, it only disables the 13th sound. While it should be the opposite! When I put 5,13 there, it should only ENABLE the original sound, being 13. So what do I need to adjust in my script? Link to comment
ViRuZGamiing Posted December 16, 2016 Share Posted December 16, 2016 (edited) So you want 1 sound ENABLED and the others DISABLED? Then loop all the sound indexs and blocks that need to be disabled and disable them not sure if disabling a block and enabling a sound in that block will Keep the rest disabled if so disable blocks only. Edited December 16, 2016 by ViRuZGamiing Link to comment
marty000123 Posted December 16, 2016 Author Share Posted December 16, 2016 11 hours ago, ViRuZGamiing said: So you want 1 sound ENABLED and the others DISABLED? Then loop all the sound indexs and blocks that need to be disabled and disable them not sure if disabling a block and enabling a sound in that block will Keep the rest disabled if so disable blocks only. I'm so sorry for the confusion but now I see I said it wrong. I mean I want 1 (original gta sa) sound disabled and the rest enabled. How do I do that? Link to comment
marty000123 Posted December 17, 2016 Author Share Posted December 17, 2016 Nevermind, figured it out. Thanks 4 the help guys 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