Jump to content

Remove original gun sounds


marty000123

Recommended Posts

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
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 by marty000123
Link to comment
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
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? :P

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