ChatFilter: use bools and add one lenny
This commit is contained in:
parent
d5d94de662
commit
8b2441866b
@ -16,9 +16,9 @@ Handle g_hCookieBlockCommands = null;
|
||||
bool g_bBlockChat[MAXPLAYERS + 1] = { false, ...};
|
||||
Handle g_hCookieBlockChat = null;
|
||||
|
||||
#define NUMBEROFLENNIES 23
|
||||
#define NUMBEROFLENNIES 24
|
||||
|
||||
char g_cLennies[NUMBEROFLENNIES][] = {"( ͡° ͜ʖ ͡°)", "͜ʖ", "(° ͜ʖ °)", "( ͝͠°͜ل͝͠°)", "( ͡° ͜ ͡°)", "( ͡°╭͜ʖ╮͡° )", "( ͠° ͜ʖ ͡°)", "( ° ͜ʖ °)", "(╯°□°)╯", "_(ツ)_", "_ツ_", "( ̿°̿ ͜ل͜ ̿°̿ )", "( ͡", "( ͠", "( ͝", "( °", "(͡", "ಠ_ಠ", "͡°", "°͡", "ʖ", "͡", "͜"};
|
||||
char g_cLennies[NUMBEROFLENNIES][] = {"( ͡° ͜ʖ ͡°)", "͜ʖ", "(° ͜ʖ °)", "( ͝͠°͜ل͝͠°)", "( ͡° ͜ ͡°)", "( ͡°╭͜ʖ╮͡° )", "( ͠° ͜ʖ ͡°)", "( ° ͜ʖ °)", "(╯°□°)╯", "_(ツ)_", "_ツ_", "( ̿°̿ ͜ل͜ ̿°̿ )", "( ͡", "( ͠", "( ͝", "( °", "(͡", "ಠ_ಠ", "͡°", "°͡", "ʖ", "͡", "͜", "っ"};
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -157,17 +157,17 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se
|
||||
public Action CCC_OnChatMessage(int client, int author, const char[] message)
|
||||
{
|
||||
int index = FindCharInString(message, '!', false);
|
||||
int lennies = 0;
|
||||
bool blennies = false;
|
||||
|
||||
for(int i = 0; i < NUMBEROFLENNIES; i++)
|
||||
{
|
||||
if(g_bHideLennies[client] && StrContains(message, g_cLennies[i], false) != -1)
|
||||
{
|
||||
lennies = 1;
|
||||
blennies = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(lennies == 1 || (g_bBlockCommands[client] && (index == 0 || index == 7)) || g_bBlockChat[client])
|
||||
if(blennies || (g_bBlockCommands[client] && (index == 0 || index == 7)) || g_bBlockChat[client])
|
||||
return Plugin_Handled;
|
||||
|
||||
return Plugin_Continue;
|
||||
|
Loading…
Reference in New Issue
Block a user