Jump to content

[HELP] setWorldSoundEnabled not working


Captain07

Recommended Posts

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

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

  • Thanks 1
Link to comment
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!

  • Like 2
Link to comment
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 by Bean666
  • Thanks 1
Link to comment

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