Raised This Month: $ Target: $400
 0% 

Sound Fire in the Hole


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TotalCS
Member
Join Date: Aug 2008
Old 12-31-2008 , 11:38   Sound Fire in the Hole
Reply With Quote #1

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

#define PLUGIN "Sound Blocker"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

new const oldsound[] = "radio/ct_fireinhole.wav";
new const newsound[] = "misc/grenada.wav";

new g_maxplayers;

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_forward( FM_EmitSound, "fw_emitsound" );
   
   g_maxplayers = get_maxplayers();
}
public plugin_precache()
   engfunc( EngFunc_PrecacheSound, newsound );
   
public fw_emitsound( Ent, Channel, const Sound[], Float:Volume, Float:Attenuation, Flags, Pitch )
{
   if( !equali( Sound, oldsound ) )
      return FMRES_IGNORED;
      
   static owner, team, i;
   owner = pev( Ent, pev_owner );
   team = get_user_team( owner );
   
   for( i = 1; i <= g_maxplayers; i++ )
   {
      if( !is_user_connected( i ) )
         continue;
      if( get_user_team( i ) != team )
         continue;
         
      emit_sound( i, CHAN_ITEM, newsound, Volume, Attenuation, Flags, Pitch );
      return FMRES_SUPERCEDE;
   }
   
   return FMRES_IGNORED;
}
It compiles well but i can`t hear the sound
TotalCS is offline
 


Thread Tools
Display Modes

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 09:11.


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