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

Block pan sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keyboard1333
Senior Member
Join Date: Aug 2013
Old 11-06-2015 , 12:43   Block pan sound
Reply With Quote #1

Is there a better way to do it instead of -

PHP Code:
public Action:SoundHook(clients[64], &numClientsString:sound[PLATFORM_MAX_PATH], &client, &channel, &Float:volume, &level, &pitch, &flags) {
    if(!
IsValidClient(client)) {
        return 
Plugin_Continue;
    }
    if(
StrContains(sound"weapons/pan/"false) != -1) {
        for(new 
i=1;i<=MaxClients;i++) {
            if(
IsValidClient(i)) {
                
StopSound(ichannelsound);
            }
        }
        return 
Plugin_Changed;
    }
    return 
Plugin_Continue;


Last edited by keyboard1333; 11-06-2015 at 12:43.
keyboard1333 is offline
SoulSharD
Member
Join Date: Oct 2013
Location: United Kingdom
Old 11-06-2015 , 16:07   Re: Block pan sound
Reply With Quote #2

You can replace the sound with 'misc/null.wav'

PHP Code:
Format(soundsizeof(sound), "misc/null.wav");
return 
Plugin_Changed
__________________

SoulSharD is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 11-07-2015 , 06:43   Re: Block pan sound
Reply With Quote #3

Using your code the player hitting things with the pan can still hear the noise, while others can't.
I know this is due to client prediction, but using the code I posted it cut out most of the sound.

Is there any way to stop the user with the pan from hearing the sound as well?

Last edited by keyboard1333; 11-07-2015 at 08:29.
keyboard1333 is offline
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 02:05.


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