Raised This Month: $ Target: $400
 0% 

Blocking Death Sound Questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mapper07
Member
Join Date: Oct 2012
Location: NY
Old 11-04-2014 , 15:27   Blocking Death Sound Questions
Reply With Quote #1

I am trying to block players from emitting the sounds made upon death.
I don't want this to happen all the time, I simply need to to occur if certain conditions are met.
For example, if the killer is using a USP, the victim should not emit any of the death sounds.
At first I thought I should do this at FM_EmitSound but then thought I might have to at DeathMsg. Can someone suggest which would work better and why?
__________________
Visit me here.



mapper07 is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 12-16-2015 , 00:41   Re: Blocking Death Sound Questions
Reply With Quote #2

On deathmessage, because it's better to do it on sight.
__________________
Like my clean plugins and work?
Baws is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-18-2015 , 22:18   Re: Blocking Death Sound Questions
Reply With Quote #3

I would do it at EmitSound since you can block it here easily.

You need to check two conditions for this:
  • Check if the player who is emitting the sound is dead because it is the only sound a dead player will ever make.
  • Check to see if the killers weapon is one of the blocked weapons and if so block the sound.
This will block death sound if killed by usp or glock. This will only work with guns/knife and not grenades, but can be modified to support grenades.
PHP Code:

#include <amxmodx>
#include <fakemeta>

new const Version[] = "0.1";

#define MAX_PLAYERS 32

#define IsPlayer(%1)    (1<=%1<=MAX_PLAYERS)

const g_IgnoreGuns = ( << CSW_USP << CSW_GLOCK18 );

new 
g_KillerMAX_PLAYERS ];

public 
plugin_init()
{
    
register_plugin"Block Death Sound" Version "bugsy" );
    
    
register_forwardFM_EmitSound "EmitSound" );
    
register_event"DeathMsg" "DeathMsg" "a" "1>0" );
}

public 
EmitSoundiEntity iChannel , const szSample[] , Float:fVolume Float:fAtten Flags Pitch 
{
    return ( 
IsPlayeriEntity ) && !is_user_aliveiEntity ) && ( g_IgnoreGuns & ( << get_user_weapong_KilleriEntity ] ) ) ) ) ? FMRES_SUPERCEDE FMRES_IGNORED;
}

public 
DeathMsg()
{
    
g_Killerread_data) ] = read_data);

__________________

Last edited by Bugsy; 12-18-2015 at 22:42.
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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