#define id skill100
#define a_sound_emitter 1
action Sound_Emitter()
{
my.id = a_sound_emitter;
var explowham = 0;
while(my){
if (key_space && !snd_playing(explowham)){
explowham = ent_playsound(me, snd_explo_wham, 200);
scan_mode = (SCAN_ENTS | SCAN_LIMIT | IGNORE_ME);
c_scan(my.x,my.pan,vector(360,0,200), scan_mode);
}
wait(1);
}
}
void _event_react_on_snd(){
if (you) if (you.id == a_sound_emitter){
//place the reaction code here, entity heard the sound
}
}
action Entity_React_On_Sound(){
my.emask |= ENABLE_SCAN;
my.event = _event_react_on_snd;
...
..
}