Jump to content

Disable original weapon sounds


Robis

Recommended Posts

Posted

Is there a way to disable original weapon sounds, as i have installed modded sounds, i need to know how to remove original.

can someone help me? :)

Posted (edited)

For me the wiki doesn't work as well. Anyway, what you should do is something like this: (this one is client sided)

function disableWeaponSounds()
     SetWorldSoundEnabled(group,value,false) --group and value should be changed. more lines can be added!
end
AddEventHandler (onClientPlayerLogin,getRootElement(),disableWeaponSounds) --the sounds will be disabled when a player joins the server permanently
AddEventHandler (onClientResourceStart,getRootElement(),disableWeaponSounds) --this will have immediate effect for everyone(not required)

The group and value can be found if you enable Development Mode in your server. To do this, you must create a resource to enable devmode. Something like this: (this one is server sided)
 

function devmodeon()
     setDevelopmentMode(true)
end
addCommandHandler("devmodeon", getRootElement(), devmodeon)

function devmodeoff()
     setDevelopmentMode(false)
end
addCommandHandler("devmodeoff", getRootElement(), devmodeoff)

Then run the devmode script.
Then type /devmodeon.
Then type /debugscript 3.
Then type /showsound 1. (in this order)

From that moment, you will see every sound you hear or your server produces (not really sure about that one) in the debugscript. It will show what group and value the sounds are in, so if you for example shoot your M4, you'll see ''group: 5, value: 21'' etc. Then you replace the ''(group,value,false) with (5,21,false) etc.

Afterwards you can do /debugscript 0 and /showsound 0 (important). If you want to turn off the development mode, you can type ''/devmodeoff''.

 (i've done this whole thing a few days ago. i could supply u with the script, but idk what gun sounds u need to be disabled and i want u to try it on ur own first)
Let me know if it worked. Good luck :)

 

- Marty

Edited by marty000123
Posted
1 hour ago, marty000123 said:

For me the wiki doesn't work as well. Anyway, what you should do is something like this: (this one is client sided)


function disableWeaponSounds()
     SetWorldSoundEnabled(group,value,false) --group and value should be changed. more lines can be added!
end
AddEventHandler (onClientPlayerLogin,getRootElement(),disableWeaponSounds) --the sounds will be disabled when a player joins the server permanently
AddEventHandler (onClientResourceStart,getRootElement(),disableWeaponSounds) --this will have immediate effect for everyone(not required)

The group and value can be found if you enable Development Mode in your server. To do this, you must create a resource to enable devmode. Something like this: (this one is server sided)
 


function devmodeon()
     setDevelopmentMode(true)
end
addCommandHandler("devmodeon", getRootElement(), devmodeon)

function devmodeoff()
     setDevelopmentMode(false)
end
addCommandHandler("devmodeoff", getRootElement(), devmodeoff)

Then run the devmode script.
Then type /devmodeon.
Then type /debugscript 3.
Then type /showsound 1. (in this order)

From that moment, you will see every sound you hear or your server produces (not really sure about that one) in the debugscript. It will show what group and value the sounds are in, so if you for example shoot your M4, you'll see ''group: 5, value: 21'' etc. Then you replace the ''(group,value,false) with (5,21,false) etc.

Afterwards you can do /debugscript 0 and /showsound 0 (important). If you want to turn off the development mode, you can type ''/devmodeoff''.

 (i've done this whole thing a few days ago. i could supply u with the script, but idk what gun sounds u need to be disabled and i want u to try it on ur own first)
Let me know if it worked. Good luck :)

 

- Marty

I can't understand what you mean with group and value.

It could be awesmoe, if you could make me a script, heres a weapon sounds to disable: (I need not modded sounds, but original sounds to disable)

M4, AK-47, Silenced Pistol, Pistol, TEC-9, MP5, Uzi, Desert Eagle, Sniper Rifle, Rifle.

Thanks! :)

Posted (edited)

All sounds have a group and index within that group. If you want to disable all sounds inside a group, you can do that. You can also disable a single sound inside a group.

bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable )

That's the syntax for the function.

What Marty was trying to say, is that you can find the group and index of the weapon shots by enabling the development mode client-side, for example with the script provided to you by Marty, and then using /debugscript 3 and /showsound 1 to find out which groups and indexes are triggered when shooting.

You should be able to do this quite easily yourself, so you might as well go and try it out now.

Edited by mgmmcaobbm
Posted
1 hour ago, mgmmcaobbm said:

All sounds have a group and index within that group. If you want to disable all sounds inside a group, you can do that. You can also disable a single sound inside a group.


bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable )

That's the syntax for the function.

What Marty was trying to say, is that you can find the group and index of the weapon shots by enabling the development mode client-side, for example with the script provided to you by Marty, and then using /debugscript 3 and /showsound 1 to find out which groups and indexes are triggered when shooting.

You should be able to do this quite easily yourself, so you might as well go and try it out now.

Hard for beginners, like me. I though that it wouldn't be that hard! :( 

Well...

Posted
17 minutes ago, Robis said:

Hard for beginners, like me. I though that it wouldn't be that hard! :( 

Well...

So executing one line of code and two commands is too difficult? Boy, the smell of lazyness.

Posted
10 hours ago, myonlake said:

So executing one line of code and two commands is too difficult? Boy, the smell of lazyness.

Do i have to script these two commands or they are built in MTA?

Posted
3 hours ago, Robis said:

Do i have to script these two commands or they are built in MTA?

I gave you step-by-step instructions.. Please tell me what part of it you don't understand.

Posted
10 hours ago, marty000123 said:

I gave you step-by-step instructions.. Please tell me what part of it you don't understand.

Everything is in control, i just made it by myself.

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