ChatFilter: optimize code
you guys proud of me? xD
This commit is contained in:
parent
97c000fc98
commit
329917f0f0
@ -148,14 +148,19 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se
|
|||||||
public Action CCC_OnChatMessage(int client, int author, const char[] message)
|
public Action CCC_OnChatMessage(int client, int author, const char[] message)
|
||||||
{
|
{
|
||||||
int index = FindCharInString(message, '!', false);
|
int index = FindCharInString(message, '!', false);
|
||||||
|
int lennies = 0;
|
||||||
|
|
||||||
for(int i = 0; i < NUMBEROFLENNIES; i++)
|
for(int i = 0; i < NUMBEROFLENNIES; i++)
|
||||||
{
|
{
|
||||||
if((g_bHideLennies[client] && StrContains(message, g_cLennies[i], false) != -1) || (g_bBlockCommands[client] && (index == 0 || index == 7)) || g_bBlockChat[client])
|
if(g_bHideLennies[client] && StrContains(message, g_cLennies[i], false) != -1)
|
||||||
{
|
{
|
||||||
|
lennies = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lennies == 1 || (g_bBlockCommands[client] && (index == 0 || index == 7)) || g_bBlockChat[client])
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
|
||||||
}
|
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user