Raised This Month: $ Target: $400
 0% 

move to trash


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-27-2019 , 18:48   Re: L4D2 How to mute auto vocalizes
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <sdktools>

public Plugin myinfo =
{
    
name "[L4D & L4D2] Manual Vocalize Only",
    
author "SilverShot",
    
description "Blocks automatic vocalizing.",
    
version "1.0",
    
url "https://forums.alliedmods.net/showthread.php?t=319943"
}

float g_fTime;

public 
void OnPluginStart()
{
    
AddCommandListener(Vocalize"vocalize");
    
AddNormalSoundHook(SoundHook);
}

public 
Action Vocalize(int client, const char[] commandint argc)
{
    
g_fTime GetGameTime() + 0.1;
}

public 
Action SoundHook(int clients[64], int &numClientschar sample[PLATFORM_MAX_PATH], int &entityint &channelfloat &volumeint &levelint &pitchint &flags)
{
    
// player/survivor/voice/
    
if( GetGameTime() > g_fTime && sample[0] == 'p' && sample[7] == 's' && sample[16] == 'v' && sample[21] == '\\' )
        return 
Plugin_Handled;
    return 
Plugin_Continue;

__________________

Last edited by Silvers; 11-27-2019 at 18:51. Reason: includes
Silvers is offline
 


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 04:55.


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