From a2194df2735deb941b848b8ce1222a0e9429821f Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 10 Sep 2013 09:52:37 -0400 Subject: [PATCH] Fix attempted triggers from gagged users displaying in chat (bug 5918, r=asherkin). --- plugins/basecomm.sp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/basecomm.sp b/plugins/basecomm.sp index aee6e7e3..712f093d 100644 --- a/plugins/basecomm.sp +++ b/plugins/basecomm.sp @@ -98,6 +98,22 @@ public OnPluginStart() { OnAdminMenuReady(topmenu); } + + // Normally, OnClientSayCommand would be aqequate and more appropirate here, but it does + // not catch attempted chat triggers, which we also want to be blocked if a player is gagged. + AddCommandListener(Command_Say, "say"); + AddCommandListener(Command_Say, "say_team"); + + new String:gameDir[64]; + GetGameFolderName(gameDir, sizeof(gameDir)); + if (StrEqual(gameDir, "insurgency", false)) + { + AddCommandListener(Command_Say, "say2"); + } + else if (StrEqual(gameDir, "nucleardawn", false)) + { + AddCommandListener(Command_Say, "say_squad"); + } } public OnAdminMenuReady(Handle:topmenu) @@ -151,7 +167,7 @@ public bool:OnClientConnect(client, String:rejectmsg[], maxlen) return true; } -public Action:OnClientSayCommand(client, const String:command[], const String:sArgs[]) +public Action:Command_Say(client, const String:command[], argc) { if (client) {