AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block rocket sound explosion(HL1) (https://forums.alliedmods.net/showthread.php?t=249312)

neverminde 10-04-2014 00:08

block rocket sound explosion(HL1)
 
Hi, i want to block sound of rocket explosion (half-life rocketluancher)
PHP Code:

"weapons/explode3.wav",
"weapons/explode4.wav",
"weapons/explode5.wav" 

I tried this forward
PHP Code:

register_forward(FM_EmitSound"block_sound"

Works with sound like
PHP Code:

"common/wpn_denyselect.wav",

"player/death1.wav",
"player/death2.wav",
"player/death3.wav",

"player/pain1.wav",
"player/pain2.wav",
"player/pain3.wav" 

but it dont work with explosion sound

HamletEagle 10-04-2014 10:02

Re: block rocket sound explosion(HL1)
 
I think that your answer is here: https://forums.alliedmods.net/showthread.php?t=249283

NiHiLaNTh 10-04-2014 11:31

Re: block rocket sound explosion(HL1)
 
in your case, you would need to hook SVC_TEMPENTITY event, since that sound is played when sending TE_EXPLOSION message (as a last param).
Code:

register_message(SVC_TEMPENTITY, "HookTempEnt");

public HookTempEnt()
{
        if( get_msg_arg_int(1) == TE_EXPLOSION)
        {
                  set_msg_arg_int(8, ARG_BYTE, 0);
        }
}

}


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

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