AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking bullet hit sound (https://forums.alliedmods.net/showthread.php?t=253819)

RateX 12-29-2014 01:27

Blocking bullet hit sound
 
Hi
When a player is hit by a gunshot, 2 sounds are emit, and one of them is "weapons/bullet_hit1.wav".
How do I block this sound from being play?

silentscope 12-31-2014 03:39

Re: Blocking bullet hit sound
 
remove the emit line?^^ anyway post the code so everyone can help you

bat 12-31-2014 08:25

Re: Blocking bullet hit sound
 
Code:

#include amxmodx
#include fakemeta

public plugin_init(){
    register_forward(FM_EmitSound, "fw_Emitsound")
}

public fw_Emitsound(const sound[])
{
        if(equali(sound,"sound/weapons/bullet_hit1.wav"))
        {
                return FMRES_SUPERCEDE;
        }
        return FMRES_IGNORED;
}


RateX 12-31-2014 10:36

Re: Blocking bullet hit sound
 
@bat:That is the first thing I did, and since it failed I post it here for help. BTW, the sound path does not contain "sound"

HamletEagle 12-31-2014 11:25

Re: Blocking bullet hit sound
 
I think that sound is client side so you can't block it with FM_EmitSound

RateX 01-02-2015 04:26

Re: Blocking bullet hit sound
 
Is there any way to block it from emitting via powerful module like orpheu/okapi/rage?

HamletEagle 01-02-2015 04:33

Re: Blocking bullet hit sound
 
Quote:

Originally Posted by RateX (Post 2243536)
Is there any way to block it from emitting via powerful module like orpheu/okapi/rage?

Nope, they are handled client side, even if you replace the string in memory with orpheu/okapi it won't work. I don't know rage, but since they are client side I guess that the answer is still no. For an example of replacing search for qim tut or look into my Entities Resources Replacement plug.

klippy 01-02-2015 05:43

Re: Blocking bullet hit sound
 
You will need to block shooting entirely, then write the code which will do exactly the same, but without sounds... I know it's stupid, but I don't know any other way around.

RateX 01-02-2015 14:22

Re: Blocking bullet hit sound
 
^The only thing I'm avoiding, though I did it anyway:). I use UpdateClientData and playback_event to preserve traceattack, and it works, with the cost of weapon sound and dynamic crosshair. So anyone have info about volume, pitch and attenuation of cs weapon sound?

klippy 01-02-2015 14:46

Re: Blocking bullet hit sound
 
I think I saw someone posting a table with those values, although I am not entirely sure.


All times are GMT -4. The time now is 15:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.