i just use the variable g_iBlockSound to block the pickupsound just when somebody is using the /weapons cmd in my plugin which increases the value by one for each weapon the palyer gets. in fwdEmitSound() it checks whether the sound should be blocked or not.
any way this shoudl work for you:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#pragma semicolon 1
#define PLUGIN "Block Weaponpickup Sound"
#define AUTHOR "SchlumPF"
#define VERSION "1.0"
new g_iCvar;
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );
g_iCvar = register_cvar( "weaponpickup_sound", "1" );
register_forward( FM_EmitSound, "fwdEmitSound_Pre", 0 );
}
public fwdEmitSound_Pre( plr, channel, const sound[] )
{
if( equal( sound, "items/gunpickup2.wav" ) )
{
if( get_pcvar_num( g_iCvar ) )
{
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
__________________