Raised This Month: $ Target: $400
 0% 

Sound Fire in the Hole


Post New Thread Reply   
 
Thread Tools Display Modes
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
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2008 , 12:24   Re: Sound Fire in the Hole
Reply With Quote #2

FM_EmitSound is not triggered for this sound.

Hook SendAudio message using register_message, then all you have to do is change the string %MRAD_XXX to the name of the (precached) sound you want, and no need to do any loop.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TotalCS
Member
Join Date: Aug 2008
Old 12-31-2008 , 12:28   Re: Sound Fire in the Hole
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
FM_EmitSound is not triggered for this sound.

Hook SendAudio message using register_message, then all you have to do is change the string %MRAD_XXX to the name of the (precached) sound you want, and no need to do any loop.
Can you fix it?
TotalCS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2008 , 13:04   Re: Sound Fire in the Hole
Reply With Quote #4

Rewritten.
Attached Files
File Type: sma Get Plugin or Get Source (fith_rep.sma - 812 views - 1.7 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-31-2008 at 13:29.
ConnorMcLeod is offline
TotalCS
Member
Join Date: Aug 2008
Old 12-31-2008 , 13:14   Re: Sound Fire in the Hole
Reply With Quote #5

It works but the when the round starts i hear the sound without throwing a grenade
TotalCS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2008 , 13:29   Re: Sound Fire in the Hole
Reply With Quote #6

I'm stupid, re-DL.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TotalCS
Member
Join Date: Aug 2008
Old 01-01-2009 , 05:35   Re: Sound Fire in the Hole
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
I'm stupid, re-DL.
Thx, +karma
TotalCS is offline
Old 05-16-2012, 12:12
MustD1e
This message has been deleted by MustD1e.
MustD1e
Senior Member
Join Date: Apr 2010
Old 05-16-2012 , 12:14   Re: Sound Fire in the Hole
Reply With Quote #8

Hello, I get (when throw grenade)
Quote:
FATAL ERROR
PW_WRITE_STRING_I_called with no active message
And there too http://forums.alliedmods.net/showthr...t=67294&page=2
__________________

Fly with us

Last edited by MustD1e; 05-16-2012 at 12:21.
MustD1e 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 09:11.


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