Captain07 Posted April 14, 2021 Share Posted April 14, 2021 Hello, I'm trying to disable default weapon sounds, but it's not working. I obtained the sounds with development mode + showsound and I turned them off, but ther are still there. Not even the example on mtawiki works, or other codes that I found. What's going on?! Thanks for reading! Link to comment
Moderators IIYAMA Posted April 14, 2021 Moderators Share Posted April 14, 2021 11 minutes ago, Captain07 said: What's going on?! Most gun sounds exist out of multiple small sounds. Maybe that is the issue? 1 Link to comment
Captain07 Posted April 14, 2021 Author Share Posted April 14, 2021 The weapon sounds are in group 5, and I disabled the whole group. Still, the sounds don't disappear. Link to comment
Erlkonig Posted April 14, 2021 Share Posted April 14, 2021 Can you show your code please? 42 minutes ago, Captain07 said: The weapon sounds are in group 5, and I disabled the whole group. Still, the sounds don't disappear. Did you try the group ID 3? 1 Link to comment
Captain07 Posted April 14, 2021 Author Share Posted April 14, 2021 33 minutes ago, Erlkonig said: Can you show your code please? Did you try the group ID 3? function toggle() setWorldSoundEnabled(5, false) setWorldSoundEnabled(3, false) end addCommandHandler("toggle", toggle) Link to comment
Erlkonig Posted April 14, 2021 Share Posted April 14, 2021 7 hours ago, Captain07 said: function toggle() setWorldSoundEnabled(5, false) setWorldSoundEnabled(3, false) end addCommandHandler("toggle", toggle) Are you sure that this is the client-side? 1 Link to comment
Kenra Posted April 15, 2021 Share Posted April 15, 2021 setWorldSoundEnabled this is the correct function as mentioned in wiki https://wiki.multitheftauto.com/wiki/SetWorldSoundEnabled use it in client-side 1 Link to comment
Captain07 Posted April 15, 2021 Author Share Posted April 15, 2021 It is in client side. I can disable other sounds, but not weapon sounds. My only guess is that there is another resource that enables them. But I have no idea which, I don't even remember doing anything like this before. Is there a way to find out which resource uses this function, without checking them one by one? Link to comment
Erlkonig Posted April 15, 2021 Share Posted April 15, 2021 37 minutes ago, Captain07 said: It is in client side. I can disable other sounds, but not weapon sounds. My only guess is that there is another resource that enables them. But I have no idea which, I don't even remember doing anything like this before. Is there a way to find out which resource uses this function, without checking them one by one? I tested this script, it works. Can you try to test it the default MTA server? 1 Link to comment
Captain07 Posted April 15, 2021 Author Share Posted April 15, 2021 22 minutes ago, Erlkonig said: I tested this script, it works. Can you try to test it the default MTA server? Yup, it's working, I stopped everything else. Now I have to find out what is messing around, I guess this is where the fun begins. Thanks everyone! 2 Link to comment
Bean666 Posted April 15, 2021 Share Posted April 15, 2021 (edited) 11 minutes ago, Captain07 said: Yup, it's working, I stopped everything else. and that's because you disabled a whole group, you need to find the index. anyway, I have a code that disables most gunshots, M4/AK is still around here i think since i didn't want to disable the rustler/seasparrow sound...( but M4/AK sounds are not noticeable if it has a custom sound anyway.. unlike Deagle, etcs) what type of sounds do u want to disable? anyway here: local removedIDs = { 33, 4, 28, 21, 22, 23, 6, 7, 8, 29, 30, 17, 18, 26, 27, 52, 53, 5, 0, 1, 2, 12, 14, 15, 16, 11 } setWorldSoundEnabled ( 5, true) for i, sound in pairs(removedIDs) do setWorldSoundEnabled(5, sound, false) end Just play with it, see what IDs u wanna remove / add. It's all weapon sounds btw. Edited April 15, 2021 by Bean666 1 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