diff --git a/SelfMute/scripting/SelfMute.sp b/SelfMute/scripting/SelfMute.sp index 9013471e..03cd9a55 100644 --- a/SelfMute/scripting/SelfMute.sp +++ b/SelfMute/scripting/SelfMute.sp @@ -67,6 +67,7 @@ public void OnPluginStart() RegConsoleCmd("sm_sm", Command_SelfMute, "Mute player by typing !sm [playername]"); RegConsoleCmd("sm_su", Command_SelfUnMute, "Unmute player by typing !su [playername]"); RegConsoleCmd("sm_cm", Command_CheckMutes, "Check who you have self-muted"); + RegAdminCmd("sm_debugtorch", Command_CheckPermaTorchMutes, ADMFLAG_GENERIC, "Check who has permanently self-muted Torch"); HookEvent("round_start", Event_Round); HookEvent("round_end", Event_Round); @@ -468,6 +469,31 @@ void UnExempt(int client, int target) /* * CHAT COMMANDS */ + +public Action Command_CheckPermaTorchMutes(int client, int args) +{ + int iTorchPermMuted; + int iPlayers; + char sBuffer[2]; + + for(int i = 1; i <= MaxClients; i++) + { + if(!IsClientInGame(i) || IsFakeClient(i)) + continue; + + GetClientCookie(i, g_hCookieTorchMuted, sBuffer, sizeof(sBuffer)); + + if(sBuffer[0] != '\0') + iTorchPermMuted++; + + iPlayers++; + } + + ReplyToCommand(client, "[SM] There are currently %d out of %d Players who've got Torch permanently self-muted.", iTorchPermMuted, iPlayers); + + return Plugin_Handled; +} + public Action Command_SelfMute(int client, int args) { if(client == 0)