Raised This Month: $12 Target: $400
 3% 

Catching ALL sound events


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-hi-
Member
Join Date: Jul 2006
Old 10-19-2007 , 05:33   Catching ALL sound events
Reply With Quote #1

I'm trying to create a plugin that will allow a user to only hear sounds generated by him/herself only. Is there a way to hook the creation of ALL sounds (footsteps, jumping, firing, etc...).

I've tried using Fakemeta to hook the EmitSound function but that only catches certain sounds not ALL sounds.

The basic idea of my plugin is to have a bunch of players in a server. If each player was blind, they would think they were playing alone.

Last edited by -hi-; 10-19-2007 at 05:39.
-hi- is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-19-2007 , 10:16   Re: Catching ALL sound events
Reply With Quote #2

Do what you're doing by hooking EmitSound and blocking them. That will block emitted sounds.

As for the rest of them, hook FM_PlaybackEvent and block those. This should also block the bullet ricocheting off the wall if I remember correctly.

If blocking all of them blocks a few you don't want to block, you can test the eventindex.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
-hi-
Member
Join Date: Jul 2006
Old 10-20-2007 , 02:54   Re: Catching ALL sound events
Reply With Quote #3

Yes, thanks Wilson. The PlaybackEvent forward is catching more of the sounds I am trying to block. The problem I'm having now is blocking the sounds. It's easy to completely block the sound using FMRES_SUPERCEDE but I want to only block it from certain players (everyone except the creator of the entity that caused the sound).
-hi- is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-20-2007 , 15:20   Re: Catching ALL sound events
Reply With Quote #4

If you block the PlaybackEvent completely, the player who caused the sound will still hear it. He hears it client-sided.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
-hi-
Member
Join Date: Jul 2006
Old 10-20-2007 , 18:19   Re: Catching ALL sound events
Reply With Quote #5

When I block it I dont see or hear anything. This is for TFC. If I throw a conc I don't hear the sound or see the blast; the grenade just disappears. Here is what I've got so far am I doing everything right?

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "Sound Blocker" #define VERSION "1.0" #define AUTHOR "hi" #pragma semicolon 1 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_forward(FM_EmitSound, "fwdEmitSound");     register_forward(FM_PlaybackEvent, "fwdPlaybackEvent"); } public fwdEmitSound(ent, iChannel, const szSample[], Float:fVolume, Float:fAttenuation, iFlags, iPitch) {     client_print(0, print_chat, "ent %d chan %d sam %s flags %d pitch %d", ent, iChannel, szSample, iFlags, iPitch);     return FMRES_SUPERCEDE; } public fwdPlaybackEvent(flags, invoker, eventindex, delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2, bparam1, bparam2) {     client_print(0, print_chat, "Playback flags %d invoker %d index %d %f %f %d %d %d %d", flags, invoker, eventindex, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2);     return FMRES_SUPERCEDE; }
-hi- is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-20-2007 , 22:18   Re: Catching ALL sound events
Reply With Quote #6

Grenades don't use playbackevents - they use emit_sound()

I can't think of a way to only emit_sound() to one person...other than shutting everyone else's volume temporarily or using client_cmd(id,"spk explosion.wav") on the one client..
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Reply


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 21:53.


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