Add canchat permission as well as godmode being a toggle command.

This commit is contained in:
Zack Piispanen 2013-10-01 04:20:52 -04:00
parent 4e9698b6ee
commit ce73b0c0b5
6 changed files with 71 additions and 16 deletions

View file

@ -914,21 +914,31 @@ namespace TShockAPI
Log.Error(ex.ToString());
}
}
else if (!tsplr.mute && !TShock.Config.EnableChatAboveHeads)
else
{
Utils.Broadcast(
String.Format(Config.ChatFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix, args.Text),
tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
args.Handled = true;
} else if (!tsplr.mute && TShock.Config.EnableChatAboveHeads)
{
Utils.Broadcast(args.Who, String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix, args.Text), tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
args.Handled = true;
}
else if (tsplr.mute)
{
tsplr.SendErrorMessage("You are muted!");
args.Handled = true;
if (!tsplr.Group.HasPermission(Permissions.canchat))
{
args.Handled = true;
}
else if (tsplr.mute)
{
tsplr.SendErrorMessage("You are muted!");
args.Handled = true;
}
else if (!TShock.Config.EnableChatAboveHeads)
{
Utils.Broadcast(
String.Format(Config.ChatFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix, args.Text),
tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
args.Handled = true;
}
else
{
Utils.Broadcast(args.Who,
String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix,
args.Text), tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
args.Handled = true;
}
}
}