예제 #1
0
        protected override void Execute(CallArgs args)
        {
            List <string> cmdsText;

            if (args.IsConsole)
            {
                cmdsText = GetHelpText(Perms.CONSOLE, false, args.IsValid(0) ? args.Get <string>(0) : null);

                foreach (string cmdText in cmdsText)
                {
                    Log.Info(cmdText);
                }
            }
            else
            {
                cmdsText = GetHelpText(args.Sender.Value.Permissions, true, args.IsValid(0) ? args.Get <string>(0) : null);

                foreach (string cmdText in cmdsText)
                {
                    SendMessageToPlayer(args.Sender, cmdText);
                }
            }
        }
예제 #2
0
        protected override void Execute(CallArgs args)
        {
            Player destination;
            Player sender;

            if (args.IsValid(1))
            {
                destination = args.Get <Player>(1);
                sender      = args.Get <Player>(0);
            }
            else
            {
                Validate.IsTrue(args.Sender.HasValue, "This command can't be used by CONSOLE");
                destination = args.Get <Player>(0);
                sender      = args.Sender.Value;
            }

            sender.Teleport(destination.Position, destination.SubRootId);
            SendMessage(sender, $"Teleported to {destination.Name}");
        }