From 75fb3b22f5e56c56bddfbace93d9cbe73ec44206 Mon Sep 17 00:00:00 2001 From: DoganGFL Date: Fri, 30 Nov 2018 16:45:14 +0100 Subject: [PATCH] attempt to fix rainbow lennies FAILED --- AntiLenny/scripting/AntiLenny.sp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/AntiLenny/scripting/AntiLenny.sp b/AntiLenny/scripting/AntiLenny.sp index 9a75fbaa..f0056d62 100644 --- a/AntiLenny/scripting/AntiLenny.sp +++ b/AntiLenny/scripting/AntiLenny.sp @@ -5,10 +5,11 @@ #include #include #include +#include bool g_bHideLennies[MAXPLAYERS + 1] = { false, ... }; -char g_cLennies[19][] = {"( ͡° ͜ʖ ͡°)", "(° ͜ʖ °)", "( ͝͠°͜ل͝͠°)", "( ͡° ͜ ͡°)", "( ͡°╭͜ʖ╮͡° )", "( ͠° ͜ʖ ͡°)", "( ° ͜ʖ °)", "(╯°□°)╯", "_(ツ)_", "_ツ_", "( ̿°̿ ͜ل͜ ̿°̿ )", "( ͡", "( ͠", "( ͝", "( °", "(͡", "ಠ_ಠ", "͡°", "°͡"}; +char g_cLennies[20][] = {"( ͡° ͜ʖ ͡°)", "͜ʖ", "(° ͜ʖ °)", "( ͝͠°͜ل͝͠°)", "( ͡° ͜ ͡°)", "( ͡°╭͜ʖ╮͡° )", "( ͠° ͜ʖ ͡°)", "( ° ͜ʖ °)", "(╯°□°)╯", "_(ツ)_", "_ツ_", "( ̿°̿ ͜ل͜ ̿°̿ )", "( ͡", "( ͠", "( ͝", "( °", "(͡", "ಠ_ಠ", "͡°", "°͡"}; public Plugin myinfo = { @@ -26,11 +27,16 @@ public void OnPluginStart() public Action CCC_OnChatMessage(int client, int author, const char[] message) { - for(int i = 0; i < 19; i++) + char buffer[192]; + strcopy(buffer, sizeof(buffer), message); + + CRemoveTags(buffer, 192); + + for(int i = 0; i < 20; i++) { - if(g_bHideLennies[client] && StrContains(message, g_cLennies[i], false) != -1) + if(g_bHideLennies[client] && StrContains(buffer, g_cLennies[i], false) != -1) { - return Plugin_Handled; + return Plugin_Handled; } } return Plugin_Continue;