Raised This Month: $32 Target: $400
 8% 

[Request] New Sound for E Key


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snake.
Senior Member
Join Date: Jul 2017
Old 06-19-2018 , 14:33   [Request] New Sound for E Key
Reply With Quote #1

Hello, what i want is terrorist can have a special sound for their e (+use) and turn it back to default with a say command. Thanks in advance !

Last edited by Snake.; 06-19-2018 at 14:55.
Snake. is offline
Send a message via Skype™ to Snake.
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-19-2018 , 17:00   Re: [Request] New Sound for E Key
Reply With Quote #2

Here you go, change SOUND_DENYSELECT and SOUND_SELECT to what you want them to be.

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

#pragma semicolon 1

new const     SOUND_DENYSELECT[]     = "denyselect.wav",
        
SOUND_SELECT[]        = "select.wav";

public 
plugin_init( )
{
    
register_plugin"Use sounds""1.1a""maqi" );
    
    
register_forwardFM_EmitSound"Fw_EmitSound" );
}

public 
plugin_precache( )
{
    
precache_soundSOUND_DENYSELECT );
    
precache_soundSOUND_SELECT );
}

public 
Fw_EmitSoundiEntiChannel, const sSound[] )
{
    if( 
equal(sSound,"common/wpn_denyselect.wav") )
    {
        
emit_soundiEntiChannelSOUND_DENYSELECTVOL_NORMATTN_NORM0PITCH_NORM );
        return 
FMRES_SUPERCEDE;
    }
    else if( 
equal(sSound,"common/wpn_select.wav") )
    {
        
emit_soundiEntiChannelSOUND_SELECTVOL_NORMATTN_NORM0PITCH_NORM );
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

__________________
stuff
maqi is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 06-19-2018 , 17:10   Re: [Request] New Sound for E Key
Reply With Quote #3

Quote:
Originally Posted by maqi View Post
Here you go, change SOUND_DENYSELECT and SOUND_SELECT to what you want them to be.

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

#pragma semicolon 1

new const     SOUND_DENYSELECT[]     = "denyselect.wav",
        
SOUND_SELECT[]        = "select.wav";

public 
plugin_init( )
{
    
register_plugin"Use sounds""1.1a""maqi" );
    
    
register_forwardFM_EmitSound"Fw_EmitSound" );
}

public 
plugin_precache( )
{
    
precache_soundSOUND_DENYSELECT );
    
precache_soundSOUND_SELECT );
}

public 
Fw_EmitSoundiEntiChannel, const sSound[] )
{
    if( 
equal(sSound,"common/wpn_denyselect.wav") )
    {
        
emit_soundiEntiChannelSOUND_DENYSELECTVOL_NORMATTN_NORM0PITCH_NORM );
        return 
FMRES_SUPERCEDE;
    }
    else if( 
equal(sSound,"common/wpn_select.wav") )
    {
        
emit_soundiEntiChannelSOUND_SELECTVOL_NORMATTN_NORM0PITCH_NORM );
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

Thanks and can you add a say command for terrorist to make it on or off ?

Last edited by Snake.; 06-19-2018 at 17:11.
Snake. is offline
Send a message via Skype™ to Snake.
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-19-2018 , 17:17   Re: [Request] New Sound for E Key
Reply With Quote #4

Here you go

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

#pragma semicolon 1

new const    plugin[]        =    "Use sound",
        
version[]        =    "1.1a",
        
author[]        =    "maqi";
        
#define MAX_PLAYERS 32

new const     SOUND_DENYSELECT[]     = "denyselect.wav",
        
SOUND_SELECT[]        = "select.wav";

new 
g_SoundEnabledMAX_PLAYERS ];
        
public 
plugin_init( )
{
    
register_pluginpluginversionauthor );
    
    
register_clcmd"say /usesound""Cmd_UseSound" );
    
register_clcmd"say_team /usesound""Cmd_UseSound" );
    
    
register_forwardFM_EmitSound"Fw_EmitSound" );
}

public 
plugin_precache( )
{
    
precache_soundSOUND_DENYSELECT );
    
precache_soundSOUND_SELECT );
}

public 
client_connectiIndex )
{
        
g_SoundEnablediIndex ] = true;
}

public 
Cmd_UseSoundiIndex )
{
    
g_SoundEnabled[iIndex] = g_SoundEnabled[iIndex] ? false true;
    
client_printiIndexprint_chat"[%s] You %s the use sound!"pluging_SoundEnabled[iIndex] ? "enabled" "disabled" );
}

public 
Fw_EmitSoundiEntiChannel, const sSound[] )
{
    if( !
is_user_connected(iEnt) )     
        return 
FMRES_IGNORED;
    
    if( 
get_user_team(iEnt) != )    
        return 
FMRES_IGNORED;
    
    if( !
g_SoundEnabled[iEnt] )    
        return 
FMRES_IGNORED;
    
    
    if( 
equal(sSound,"common/wpn_denyselect.wav") )
    {
        
emit_soundiEntiChannelSOUND_DENYSELECTVOL_NORMATTN_NORM0PITCH_NORM );
        return 
FMRES_SUPERCEDE;
    }
    else if( 
equal(sSound,"common/wpn_select.wav") )
    {
        
emit_soundiEntiChannelSOUND_SELECTVOL_NORMATTN_NORM0PITCH_NORM );
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

__________________
stuff

Last edited by maqi; 06-19-2018 at 17:44.
maqi is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 06-19-2018 , 17:43   Re: [Request] New Sound for E Key
Reply With Quote #5

Thanks. <3
Snake. is offline
Send a message via Skype™ to Snake.
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-19-2018 , 17:45   Re: [Request] New Sound for E Key
Reply With Quote #6

Anytime, I also edited the code above and you can use this piece to determine if its gonna be On or Off by default

PHP Code:
public client_connectiIndex )
{
        
g_SoundEnablediIndex ] = true;

If you don't want it to be On, replace true with false. Cheers
__________________
stuff
maqi 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 10:53.


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