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[] command, int argc)
{
g_fTime = GetGameTime() + 0.1;
}
public Action SoundHook(int clients[64], int &numClients, char sample[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &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;
}
__________________