Raised This Month: $32 Target: $400
 8% 

[ANY] Sound filter (v0.1)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
epicoder
Junior Member
Join Date: Oct 2012
Plugin ID:
5272
Plugin Version:
0.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Filters sounds by substring
    Old 07-04-2016 , 22:30   [ANY] Sound filter (v0.1)
    Reply With Quote #1

    Sound filter (v0.1)
    This plugin loads a list of strings from a configuration file, then prevents any sounds that contain any of those strings in their filename from playing.

    Configuration
    The configuration is loaded as a KeyValues file from configs/disabledsounds.cfg. It should contain a list of case-insensitive substrings to test for.
    As an example, I use this configuration (also attached to the post) on my TF2 jump server to disable soldier/demoman pain sounds and fall damage sounds.
    Code:
    "Sounds" //substrings
    {
        "1"    "soldier_painsevere"
        "2"    "soldier_painsharp"
        "3"    "demoman_painsharp"
        "4"    "demoman_painsevere"
        "5"    "pl_fallpain"
        "6"    "pl_fleshbreak"
    }
    Convars/Commands
    • sm_soundfilter_enabled: 1 to enable, 0 to disable. Default 1.
    • sm_soundfilter_reload: Reload list of strings from disk.
    I have only tested this on TF2, but theoretically it should work on any source mod that supports Sourcemod 1.7 or 1.8.
    Attached Files
    File Type: sp Get Plugin or Get Source (soundfilter.sp - 442 views - 2.1 KB)
    File Type: cfg disabledsounds.cfg (175 Bytes, 402 views)
    File Type: smx soundfilter.smx (5.2 KB, 216 views)
    __________________
    Missile ponies aren't everything in life, you know. But I have three, so I still win.

    Last edited by epicoder; 07-04-2016 at 22:31.
    epicoder is offline
    luki1412
    Veteran Member
    Join Date: Oct 2008
    Location: OnPluginStart()
    Old 07-05-2016 , 15:14   Re: [ANY] Sound filter (v0.1)
    Reply With Quote #2

    You can't block clientside sounds like footsteps using this method though.
    __________________
    luki1412 is offline
    epicoder
    Junior Member
    Join Date: Oct 2012
    Old 07-06-2016 , 11:17   Re: [ANY] Sound filter (v0.1)
    Reply With Quote #3

    True enough. I didn't take footsteps into consideration since I developed this in TF2, where footsteps aren't quite as important as they are in other games.
    According to this post, you can silence footsteps by using the method this plugin does as well as setting sv_footsteps to 0 using SendConVarValue. I haven't tested it myself, though.
    __________________
    Missile ponies aren't everything in life, you know. But I have three, so I still win.
    epicoder 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 11:50.


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