Jump to content

Remove original gun sounds


marty000123

Recommended Posts

Posted

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

Posted

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? 

 

Posted

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.

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

Posted

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

Posted (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 by marty000123
Posted

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.

  • Like 1
Posted
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?

Posted (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 by ViRuZGamiing
Posted
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

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