Wow, I haven't seen that plugin in years.....Don't use it. First off, I made it. Ignore the fact that's a completely different account in that thread from this one (it's a long story), but I made it. And I made it in 2011, when I was first learning SourceMod. It's probably not good.
Edit: Ok so I looked at the source code. I wouldn't say it's baaaaaad. It's...functional, I guess. I could really slim things down.
Edit 2: I made it less bad and updated the syntax;
Spoiler
Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo =
{
name = "No Voice Subtitles Revival",
author = "404UNF",
description = "Removes all in-chat messages when using Voice commands.",
version = "1.1",
url = "http://www.404UNF.ca"
}
public void OnPluginStart()
{
HookUserMessage(GetUserMessageId("VoiceSubtitle"), VoiceHook, true);
}
public Action VoiceHook(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init)
{
int clientid = BfReadByte(bf);
int voicemenu1 = BfReadByte(bf);
int voicemenu2 = BfReadByte(bf);
if (IsPlayerAlive(clientid) && IsClientInGame(clientid))
{
if (voicemenu1 == 0)
{
switch (voicemenu2)
{
case 0, 1, 2, 3, 4, 5, 6, 7: return Plugin_Handled;
}
}
if (voicemenu1 == 1)
{
switch (voicemenu2)
{
case 0, 1, 2, 6: return Plugin_Handled;
}
}
if((voicemenu1 == 2) && (voicemenu2 == 0)) return Plugin_Handled;
}
return Plugin_Continue;
}
Edit 3: I've started pondering removing the voice menu checks and just flat out returning Plugin_Handled as a viable option.
Last edited by 404UserNotFound; 03-31-2019 at 19:37.