Raised This Month: $ Target: $400
 0% 

Blocking Death Sound Questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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