AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Block pan sound (https://forums.alliedmods.net/showthread.php?t=274349)

keyboard1333 11-06-2015 12:43

Block pan sound
 
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;



SoulSharD 11-06-2015 16:07

Re: Block pan sound
 
You can replace the sound with 'misc/null.wav'

PHP Code:

Format(soundsizeof(sound), "misc/null.wav");
return 
Plugin_Changed


keyboard1333 11-07-2015 06:43

Re: Block pan sound
 
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?


All times are GMT -4. The time now is 05:56.

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