Ok I finally found the bug! It wasn't in my plugin actually, it was in the permission plugin:
[code=csharp]
if (userIsInGroup != "Admin")
{
if (!lowMsg.StartsWith("!"))
return ChatType.ChatAll;
[/code]
return ChatType.ChatAll;
I replaced it with ChatContinue and it worked! Also I added a few more functions:
!chat - disable all the tags
!toggletag - enables/disables your tag
[code=csharp]
using System;
using System.Collections.Generic;
using Addon;
using System.Text;
namespace ClassLibrary1
{
public class Class1:CPlugin
{
Dictionary<string, string> xuids = new Dictionary<string, string>();
bool togglechat = false;
Dictionary<string, bool> chat = new Dictionary<string, bool>();
public override void OnServerLoad()
{
ServerPrint("ChatPlugin by 8Q4S8 loaded!");
string admin = GetServerCFG("Permission", "Admin_xuids", "");
string[] admins = admin.Split(',');
string mod = GetServerCFG("Permission", "Moderator_xuids", "");
string[] mods = mod.Split(',');
foreach (string xuid in mods)
{
xuids.Add(xuid, "Mod");
}
foreach (string xuidz in admins)
{
xuids.Add(xuidz, "Admin");
}
}
public override ChatType OnSay(string Message, ServerClient Client)
{
if (!Message.StartsWith("!") && togglechat == false && chat[Client.XUID] == false)
{
if (xuids.ContainsKey(Client.XUID))
{
ServerSay("^1[" + xuids[Client.XUID]+ "] ^8" + Client.Name + "^7:^1 " + Message, true);
return ChatType.ChatNone;
}
}
if (Message.ToLower() == "!chat")
{
togglechat = !togglechat;
return ChatType.ChatNone;
}
if (Message.ToLower() == "!toggletag")
{
chat[Client.XUID] = !chat[Client.XUID];
return ChatType.ChatNone;
}
return ChatType.ChatContinue;
}
public override void OnPlayerConnect(ServerClient Client)
{
chat.Add(Client.XUID, false);
}
public override void OnPlayerDisconnect(ServerClient Client)
{
chat.Remove(Client.XUID);
}
}
}
[/code]
You can also change the code back to the version with List<>, it should work too.
I also attached the edited permission plugin, credits for that go obviously to @
Pozzuh