Code:
TextPacket textPacket = (TextPacket)packet;
foreach (string str in NotifierConfig.Default.Whitelist)
{
if (textPacket.Text.ToLower().Contains(str.ToLower()))
{
foreach (string strb in NotifierConfig.Default.Blacklist)
{
if (textPacket.Text.ToLower().Contains(strb.ToLower()))
{
textPacket.Send = true;
}
else
{
client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, str + " called!"));
}
}
}
}
What I would like this code to do is first look through a given text packet sent for words in a whitelist, and if it has a word/string in there, it must then check for words/strings from a blacklist. If it has a blacklist word, nothing happens. If it does not contain a banned word, it will display a notification saying *word from whitelist* called!
I had a pretty clear envisioning of how it would work, but it just won't
But maybe one of you guys are more experienced and can help me.
Thanks!