Add notify msg for online player group change
This makes it more consistent with how /tempgroup works, since that tells the target player of their group change. Also added silent command support.
This commit is contained in:
parent
35d9a8e715
commit
8ebecd9ff2
1 changed files with 6 additions and 0 deletions
|
|
@ -1116,6 +1116,12 @@ namespace TShockAPI
|
||||||
TShock.UserAccounts.SetUserGroup(account, args.Parameters[2]);
|
TShock.UserAccounts.SetUserGroup(account, args.Parameters[2]);
|
||||||
TShock.Log.ConsoleInfo(args.Player.Name + " changed account " + account.Name + " to group " + args.Parameters[2] + ".");
|
TShock.Log.ConsoleInfo(args.Player.Name + " changed account " + account.Name + " to group " + args.Parameters[2] + ".");
|
||||||
args.Player.SendSuccessMessage("Account " + account.Name + " has been changed to group " + args.Parameters[2] + "!");
|
args.Player.SendSuccessMessage("Account " + account.Name + " has been changed to group " + args.Parameters[2] + "!");
|
||||||
|
|
||||||
|
var players = TSPlayer.FindByNameOrID(account.Name);
|
||||||
|
if (players.Count == 0)
|
||||||
|
return;
|
||||||
|
else if (!args.Silent)
|
||||||
|
players[0].SendSuccessMessage($"{args.Player.Name} has changed your group to {args.Parameters[2]}");
|
||||||
}
|
}
|
||||||
catch (GroupNotExistsException)
|
catch (GroupNotExistsException)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue