Raised This Month: $51 Target: $400
 12% 

How to remove 'kill' sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tcPane
Senior Member
Join Date: Sep 2010
Old 08-17-2012 , 07:01   How to remove 'kill' sound
Reply With Quote #1

Hello,
how can I remove 'kill' sound?

Explain:
When player write kill in the console, he dies and run sound. I want to remove this sound. How?
tcPane is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-17-2012 , 08:02   Re: How to remove 'kill' sound
Reply With Quote #2

Code:
#include <amxmodx> #include <fakemeta> new g_die_sounds[][] = {     "player/die1.wav",     "player/die2.wav",     "player/die3.wav",     "player/death6.wav" };     public plugin_precache() {     register_plugin( "Block die sound", "1.0", "matsi" );     register_forward( FM_EmitSound, "FwdEmitSound" ); } public FwdEmitSound( const entity, const channel, const sound[], const Float:volume, const Float:attenuation, const flags, const pitch ) {     for( new i; i < sizeof g_die_sounds; i ++ )     {         if( equal( sound, g_die_sounds[ i ] ) )         return FMRES_SUPERCEDE;     }     return FMRES_IGNORED; }

I'm not sure if thats the correct way to do it or if there are all the sounds you wanted to be blocked.

But try it.

Last edited by matsi; 08-17-2012 at 08:30.
matsi is offline
tcPane
Senior Member
Join Date: Sep 2010
Old 08-18-2012 , 02:36   Re: How to remove 'kill' sound
Reply With Quote #3

Thank you, this works, but is there more short way?
tcPane is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-18-2012 , 07:43   Re: How to remove 'kill' sound
Reply With Quote #4

Short way? What is wrong with this way?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-18-2012 , 08:01   Re: How to remove 'kill' sound
Reply With Quote #5

Little optimazation.

PHP Code:
#include <amxmodx>
#include <fakemeta>

new Trie:g_tBlockPlayersSounds

new g_iMaxPlayers
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
    
public plugin_precache()
{
    
register_plugin"Block die sound""1.1""matsi" );
    
    
register_forwardFM_EmitSound"FwdEmitSound" );

    new 
die_sounds[][] =
    {
        
"player/die1.wav",
        
"player/die2.wav",
        
"player/die3.wav",
        
"player/death6.wav"
    
};
    
g_tBlockPlayersSounds TrieCreate();
    for(new 
ii<sizeof(die_sounds); i++)
    {
        
TrieSetCell(g_tBlockPlayersSoundsdie_sounds[i], 1);
    }

    
g_iMaxPlayers get_maxplayers();
}

public 
FwdEmitSound( const entity, const channel, const sound[] /* , const Float:volume, const Float:attenuation, const flags, const pitch */ )
{
    if( 
IsPlayer(entity) && TrieKeyExists(g_tBlockPlayersSoundssound) )
    {
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-18-2012 at 08:02.
ConnorMcLeod 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 06:35.


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