Here is a little script of mine.
This stops Survivors from vocalizing about specials that ain't active. Such as Survivors screaming TANNNK! when hes not even spawned yet. Same with the Witch.
Only works on COOP.
PHP Code:
#include <sourcemod>
#include <sdktools>
#include "vocalizefatigue"
public Plugin:myinfo =
{
name = "Vocalize Warnings",
author = "Mr. Zero",
description = "Stops Survivors vocalizing warnings about specials that aint active.",
version = "1.0",
url = "http://forums.alliedmods.net/showthread.php?t=150357"
}
public OnPluginStart()
{
/* */
}
public Action:L4D_OnClientVocalize(client, const String:vocalize[], bool:byPlugin)
{
if (byPlugin) return Plugin_Continue; // If client was asked to vocalize by a plugin, allow
if (StrEqual(vocalize, "playeralsowarntank") || (StrEqual(vocalize, "playerwarntank"))) // Player is trying to warn about a tank
{
if (!IsAnyTankAlive()) // If no tanks are alive
{
return Plugin_Handled; // Stop vocalization
}
}
if (StrEqual(vocalize, "playeralsowarnwitch") || (StrEqual(vocalize, "playerwarnwitch"))) // Player is trying to warn about a witch
{
if (!IsAnyWitchAlive()) // If no witches are alive
{
return Plugin_Handled; // Stop vocalization
}
}
return Plugin_Continue; // Allow vocalization
}
static bool:IsAnyTankAlive()
{
decl String:name[32];
for (new client = 1; client <= MaxClients; client++)
{
if (!IsClientInGame(client) || !IsFakeClient(client)) continue;
if (!IsPlayerAlive(client) || GetClientHealth(client) < 1) continue;
GetClientName(client, name, 32);
if (StrContains(name, "tank", false) != -1)
{
return true;
}
}
return false;
}
static bool:IsAnyWitchAlive()
{
return (FindEntityByClassname(-1, "witch") > 0);
}