Example #1
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.autoscale"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.autoscale\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: autoscale on (value)";
                return(false);
            }

            if (!float.TryParse(arguments.At(0), out float scalevar))
            {
                response = $"Invalid value for auto scaling value: {arguments.At(0)}";
                return(false);
            }

            foreach (Player Ply in Player.List)
            {
                Ply.Scale = new Vector3(scalevar, scalevar, scalevar);
                CreativeToolboxEventHandler.PlayersWithRetainedScale.Add(Ply.UserId);
            }

            if (!CreativeToolbox.ConfigRef.Config.DisableAutoScaleMessages)
            {
                Map.Broadcast(5, $"Everyone has been set to {scalevar}x their normal size!");
            }
            CreativeToolboxEventHandler.AutoScaleOn = true;
            response = $"Everyone has been set to {scalevar}x their normal size";
            return(true);
        }
Example #2
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (!((CommandSender)sender).CheckPermission("at.jail"))
            {
                response = "You do not have permission to use this command";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: jail (player id / name)";
                return(false);
            }

            Player Ply = Player.Get(arguments.At(0));

            if (Ply == null)
            {
                response = $"Player not found: {arguments.At(0)}";
                return(false);
            }

            if (Plugin.JailedPlayers.Any(j => j.Userid == Ply.UserId))
            {
                Timing.RunCoroutine(EventHandlers.DoUnJail(Ply));
                response = $"Player {Ply.Nickname} has been unjailed now";
            }
            else
            {
                Timing.RunCoroutine(EventHandlers.DoJail(Ply));
                response = $"Player {Ply.Nickname} has been jailed now";
            }
            return(true);
        }
Example #3
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!sender.CheckPermission("953.spawn"))
            {
                response = "Insufficient permission. Required: 953.spawn";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Syntax: spawn953 <Player>";
                return(false);
            }

            Player player = Player.Get(arguments.At(0));

            if (player == null)
            {
                response = $"Unable to find a user from '{arguments.At(0)}'.";
                return(false);
            }

            player.GameObject.AddComponent <Scp953Component>();
            response = $"Set {player.Nickname} to a Scp935.";
            return(true);
        }
Example #4
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            response = "USAGE";
            if (arguments.Count < 4)
            {
                return(false);
            }

            if (!int.TryParse(arguments.At(3), out int scpLeft) || !int.TryParse(arguments.At(2), out int mtfNum) ||
                !char.IsLetter(arguments.At(0)[0]))
            {
                return(false);
            }

            if (scpLeft > Pro079Mtf.Singleton.Config.MaxScp)
            {
                response = "";
                return(false);
            }

            Exiled.API.Features.Cassie.Message(
                "MtfUnit epsilon 11 designated nato_" + arguments.At(0)[0] + " " + mtfNum + " " +
                "HasEntered AllRemaining AwaitingRecontainment" + " " + scpLeft + " " + "scpsubjects");
            response = Pro079.Pro079.Singleton.Translations.Success;
            return(true);
        }
Example #5
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (!((CommandSender)sender).CheckPermission("at.kick"))
            {
                response = "You do not have permission to use this command";
                return(false);
            }

            if (arguments.Count < 2)
            {
                response = "Usage: kick (player id / name) (reason)";
                return(false);
            }

            GameObject Ply = Exiled.API.Features.Player.Get(arguments.At(0)).GameObject;

            if (Ply == null)
            {
                response = $"Player not found: {arguments.At(0)}";
                return(false);
            }

            ServerConsole.Disconnect(Ply, EventHandlers.FormatArguments(arguments, 1));
            response = $"Player {Exiled.API.Features.Player.Get(arguments.At(0)).Nickname} has been kicked for \"{EventHandlers.FormatArguments(arguments, 1)}\"";
            return(true);
        }
Example #6
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.explode"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.explode\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: explode person (player id / name)";
                return(false);
            }

            Player ply = Player.Get(arguments.At(0));

            if (ply == null)
            {
                response = $"Invalid target to explode: {arguments.At(0)}";
                return(false);
            }

            if (ply.Role == RoleType.Spectator || ply.Role == RoleType.None)
            {
                response = $"Player \"{ply.Nickname}\" is not a valid class to explode";
                return(false);
            }

            ply.Kill();
            CreativeToolboxEventHandler.SpawnGrenadeOnPlayer(ply, false);
            response = $"Player \"{ply.Nickname}\" game ended (exploded)";
            return(true);
        }
 public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
 {
     if (!((CommandSender)sender).CheckPermission("CassiePlugin.cassie"))
     {
         response = "You do not have permission to use this command";
         return(false);
     }
     if (arguments.Count != 2)
     {
         response = "Usage: cbc (plurality 0-1) (zone 1-4)";
         return(false);
     }
     if (!(arguments.At(0).Equals("0")) && !(arguments.At(0).Equals("1")))
     {
         response = "Usage: cbc (plurality 0-1) (zone 1-4)";
         return(false);
     }
     if (!(arguments.At(1).Equals("1")) && !(arguments.At(1).Equals("2")) && !(arguments.At(1).Equals("3")) && !(arguments.At(1).Equals("4")))
     {
         response = "Usage: cbc (plurality 0-1) (zone 1-4)";
         return(false);
     }
     Cassie.Message("ATTENTION . LAST TARGET" + getPlural(arguments.At(0)) + " " + getZone(arguments.At(1)));
     response = "Cassie broadcast sent. ";
     return(true);
 }
Example #8
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!sender.CheckPermission("035.spawnitem"))
            {
                response = "Insufficient permission. Required: 035.spawnitem";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Syntax: 035 item <Amount>";
                return(false);
            }

            if (!int.TryParse(arguments.At(0), out int amount))
            {
                response = $"Could not parse \"{arguments.At(0)}\" as a number.";
                return(false);
            }

            StringBuilder stringBuilder = StringBuilderPool.Shared.Rent().AppendLine("Spawned Items:");

            foreach (Pickup item in API.SpawnItems(amount))
            {
                stringBuilder.AppendLine($"ItemType: {item.itemId} - Position: {item.transform.position}");
            }

            response = StringBuilderPool.Shared.ToStringReturn(stringBuilder);
            return(true);
        }
Example #9
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!((CommandSender)sender).CheckPermission("fctrl.zones"))
            {
                response = "Access denied.";
                return(false);
            }
            if (arguments.Count() < 1)
            {
                response = "Invalid format. Must be: \"blackoutzone light/heavy/entrance\" (eg. closezone light)";
                return(false);
            }
            if (arguments.At(0).ToLower() != "light" && arguments.At(0).ToLower() != "heavy" && arguments.At(0).ToLower() != "entrance")
            {
                response = "First argument must be light, heavy, or entrance";
                return(false);
            }
            ZoneType zone = (arguments.At(0).ToLower() == "light" ? ZoneType.LightContainment : (arguments.At(0).ToLower() == "heavy" ? ZoneType.HeavyContainment : (arguments.At(0).ToLower() == "entrance" ? ZoneType.Entrance : ZoneType.Unspecified)));

            foreach (Room r in Map.Rooms)
            {
                if (r.Zone == zone)
                {
                    foreach (Door d in r.Doors)
                    {
                        d.SetStateWithSound(false);
                    }
                }
            }
            response = $"Successfully closed all the doors in {zone.ToString()}";
            return(true);
        }
Example #10
0
        /// <inheritdoc/>
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!sender.CheckPermission("ep.removegroup"))
            {
                response = "You can't add a new group, you don't have \"ep.removegroup\" permission.";
                return(false);
            }

            if (arguments.Count == 1)
            {
                Permissions.Reload();

                if (!Permissions.Groups.ContainsKey(arguments.At(0)))
                {
                    response = $"Group {arguments.At(0)} does not exists.";
                    return(false);
                }

                Permissions.Groups.Remove(arguments.At(0));
                Permissions.Save();

                Permissions.Reload();

                response = $"Group {arguments.At(0)} has been removed.";
                return(true);
            }
            else
            {
                response = "EP GROUPS REMOVE <NAME>";
                return(false);
            }
        }
Example #11
0
 public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
 {
     if (arguments.At(0) != "")
     {
         if (arguments.At(0) == "0")
         {
             WillDecont = true;
             response   = "Decontamination is now disabled!";
             return(true);
         }
         else if (arguments.At(0) == "1")
         {
             WillDecont = false;
             response   = "Decontamination is now enabled!";
             return(true);
         }
         else
         {
             response = "invalid argument. please input 0 for disabled or 1 for enabled.";
             return(false);
         }
     }
     else
     {
         response = "please input 0 for disabled or 1 for enabled.";
         return(false);
     }
 }
Example #12
0
        /// <inheritdoc />
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!sender.CheckPermission(RequiredPermission))
            {
                response = $"Insufficient permission. Required: {RequiredPermission}";
                return(false);
            }

            if (arguments.Count < 1)
            {
                response = "Usage: \"lights <duration> [HczOnly?]\"";
                return(false);
            }

            if (!float.TryParse(arguments.At(0), out float duration))
            {
                response = $"Could not parse \"{arguments.At(0)}\" as a duration.";
                return(false);
            }

            bool hczOnly = false;

            if (arguments.Count > 1)
            {
                hczOnly = Plugin.Instance.Config.Command.AcceptedArguments.Contains(arguments.At(1), StringComparison.OrdinalIgnoreCase);
            }

            int shortDuration = (int)duration;

            Plugin.EventHandlers.TurnOffLights(duration, hczOnly);
            response = $"The lights have been turned off for {shortDuration} {(shortDuration == 1 ? "second" : "seconds")} {(hczOnly ? "in heavy containment" : "facility-wide")}.";
            return(true);
        }
Example #13
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            Player player = Player.Get(arguments.At(0));

            if (!Permissions.CheckPermission((CommandSender)sender, "scp372.spawn"))
            {
                response = "You do not have permissions to run this command!";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: spawn372 (player id / name)";
                return(false);
            }

            if (player == null)
            {
                response = $"Player not found: {arguments.At(0)}";
                return(false);
            }

            Handlers.Add372(player);
            response = $"Spawned {player.Nickname} as SCP-372!";
            return(true);
        }
Example #14
0
        /// <inheritdoc/>
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!sender.CheckPermission("sh.spawnteam"))
            {
                response = "You don't have permission to execute this command. Required permission: sh.spawnteam";
                return(false);
            }
            else
            {
                uint validPlayers = 0;
                foreach (Player player in Player.List.Where(x => x.Team == Team.RIP && !x.IsOverwatchEnabled))
                {
                    validPlayers++;
                }

                if (arguments.Count == 0)
                {
                    uint maxSquad = UIURescueSquad.Instance.Config.SpawnManager.MaxSquad;

                    if (validPlayers >= maxSquad)
                    {
                        EventHandlers.IsSpawnable = true;
                        Respawn.ForceWave(SpawnableTeamType.NineTailedFox);
                        EventHandlers.IsSpawnable = false;

                        response = $"UIU Rescue Squad team has been successfully spawned with {maxSquad} players!";
                        return(true);
                    }
                    else
                    {
                        response = $"There is not enough Spectators to spawn UIU Rescue Squad with {maxSquad} players. Required {maxSquad - validPlayers} more.";
                        return(false);
                    }
                }
                else
                {
                    if (!uint.TryParse(arguments.At(0), out uint num) || num == 0)
                    {
                        response = $"\"{arguments.At(0)}\" is not a valid number.";
                        return(false);
                    }

                    if (validPlayers >= num)
                    {
                        EventHandlers.IsSpawnable = true;
                        EventHandlers.MaxPlayers  = num;
                        Respawn.ForceWave(SpawnableTeamType.NineTailedFox);
                        EventHandlers.IsSpawnable = false;

                        response = $"UIU Rescue Squad team with {num} players has been spawned.";
                        return(true);
                    }
                    else
                    {
                        response = $"There is not enough Spectators to spawn UIU Rescue Squad with {num} players. Required {num - validPlayers} more.";
                        return(false);
                    }
                }
            }
        }
Example #15
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.customnade"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.customnade\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: customnade flash (value)";
                return(false);
            }

            if (!float.TryParse(arguments.At(0), out float flashtime) || flashtime < 0.05)
            {
                response = $"Invalid value for flash grenade timer: {arguments.At(0)}";
                return(false);
            }

            CreativeToolbox.ConfigRef.Config.FlashGrenadeFuseTimer = flashtime;
            if (!CreativeToolbox.ConfigRef.Config.PreventCtBroadcasts)
            {
                Map.Broadcast(5, $"Flash grenades will now explode after {flashtime} seconds!");
            }
            response = $"Flash grenades will now explode after {flashtime} seconds";
            return(true);
        }
Example #16
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!((CommandSender)sender).CheckPermission("fctrl.respawn"))
            {
                response = "Access denied.";
                return(false);
            }
            if (arguments.Count() < 1)
            {
                response = "Proper usage: \"forcerespawn (mtf/chaos)\"";
                return(false);
            }
            if (arguments.At(0).ToLower() != "mtf" && arguments.At(0).ToLower() != "chaos")
            {
                response = "Provided argument must be \"mtf\" or \"chaos\".";
                return(false);
            }
            SpawnableTeamType spawningTeam = (arguments.At(0).ToLower() == "mtf" ? SpawnableTeamType.NineTailedFox : SpawnableTeamType.ChaosInsurgency);
            float             length       = (spawningTeam == SpawnableTeamType.NineTailedFox ? 18f : 13f);

            RespawnManager.Singleton.RestartSequence(); // Prevent the opposite team from spawning while the forced team's animation is playing.
            RespawnEffectsController.ExecuteAllEffects(RespawnEffectsController.EffectType.Selection, spawningTeam);
            Timing.CallDelayed(length, () =>
            {
                RespawnManager.Singleton.ForceSpawnTeam(spawningTeam);
            });
            response = $"Forcing {spawningTeam} spawn...";
            return(true);
        }
Example #17
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (!CommandProcessor.CheckPermissions(((CommandSender)sender), "broadcast", PlayerPermissions.Broadcasting, "AdminTools", false))
            {
                response = "You do not have permission to use this command";
                return(false);
            }

            if (arguments.Count < 2)
            {
                response = "Usage: playerbroadcast (player id / name) (time) (message)";
                return(false);
            }

            Player Ply = Player.Get(arguments.At(0));

            if (Ply == null)
            {
                response = $"Player not found: {arguments.At(0)}";
                return(false);
            }

            if (!ushort.TryParse(arguments.At(1), out ushort time) && time <= 0)
            {
                response = $"Invalid value for duration: {arguments.At(1)}";
                return(false);
            }

            Ply.Broadcast(time, EventHandlers.FormatArguments(arguments, 2));
            response = $"Message sent to {Ply.Nickname}";
            return(true);
        }
 public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
 {
     if (!((CommandSender)sender).CheckPermission("fctrl.elevators"))
     {
         response = "Access denied.";
         return(false);
     }
     if (arguments.Count() < 1)
     {
         response = "Proper usage: \"nukeelevator (on/off)\"";
         return(false);
     }
     if (arguments.At(0) != "on" && arguments.At(0) != "off")
     {
         response = "Provided argument must be \"on\" or \"off\".";
         return(false);
     }
     foreach (Lift l in Map.Lifts.Where(i => i.elevatorName == ""))
     {
         l.SetLock(arguments.At(0) == "on" ? false : true);
         l.SetStatus((byte)1);
         l.UseLift();
     }
     response = $"Successfully {(arguments.At(0) == "on" ? "enabled" : "disabled")} the nuke elevator.";
     return(true);
 }
Example #19
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (!CommandProcessor.CheckPermissions(((CommandSender)sender), "broadcast", PlayerPermissions.Broadcasting, "AdminTools", false))
            {
                response = "You do not have permission to use this command";
                return(false);
            }

            if (arguments.Count < 2)
            {
                response = "Usage: adminbroadcast (time) (message)";
                return(false);
            }

            if (!ushort.TryParse(arguments.At(0), out ushort t))
            {
                response = $"Invalid value for broadcast time: {arguments.At(0)}";
                return(false);
            }

            foreach (Player Pl in Player.List)
            {
                if (Pl.ReferenceHub.serverRoles.RemoteAdmin)
                {
                    Pl.Broadcast(t, EventHandlers.FormatArguments(arguments, 1) + $" - {((CommandSender)sender).Nickname}", Broadcast.BroadcastFlags.AdminChat);
                }
            }

            response = $"Message sent to all currently online staff";
            return(true);
        }
Example #20
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.autorespawn"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.autorespawn\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: arspawn time (value)";
                return(false);
            }

            if (!float.TryParse(arguments.At(0), out float respawn))
            {
                response = $"Invalid value for respawn timer: {arguments.At(0)}";
                return(false);
            }

            Instance.Config.RandomRespawnTimer = respawn;
            if (!Instance.Config.PreventCtBroadcasts)
            {
                Map.Broadcast(5, $"Auto respawning timer is now set to {respawn}!");
            }
            response = "Auto respawning timer is now set to {respawn}";
            return(true);
        }
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (arguments.Count != 1)
            {
                response = string.Format(DiscordIntegration.Language.InvalidParametersError, 1);
                return(false);
            }

            if (!sender.CheckPermission("di.remove.role"))
            {
                response = string.Format(DiscordIntegration.Language.NotEnoughPermissions, "di.remove.role");
                return(false);
            }

            if (!DiscordIntegration.Network.IsConnected)
            {
                response = DiscordIntegration.Language.BotIsNotConnectedError;
                return(false);
            }

            if (!arguments.At(0).IsValidDiscordRoleId())
            {
                response = string.Format(DiscordIntegration.Language.InvalidDiscordRoleIdError, arguments.At(0));
                return(false);
            }

            _ = DiscordIntegration.Network.SendAsync(new RemoteCommand("removeRole", arguments.At(0), sender.GetCompatible()));

            response = DiscordIntegration.Language.RemoveRoleCommandSuccess;
            return(false);
        }
Example #22
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.nuke"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.nuke\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: nuke start (value)";
                return(false);
            }

            if (!float.TryParse(arguments.At(0), out float nukeTimer) || (nukeTimer < 0.05 || nukeTimer > 142))
            {
                response = $"Invalid value for nuke timer: {arguments.At(0)}";
                return(false);
            }

            Warhead.Start();
            Warhead.DetonationTimer = nukeTimer;
            response = $"The warhead has started at {nukeTimer} seconds";
            return(true);
        }
Example #23
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.regen"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.regen\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: regen healtime (value)";
                return(false);
            }

            if (!float.TryParse(arguments.At(0), out float healTime) || healTime < 0.05)
            {
                response = $"Invalid value for healing time interval: {arguments.At(0)}";
                return(false);
            }

            Instance.Config.RegenerationValue = healTime;
            if (!Instance.Config.PreventCtBroadcasts)
            {
                Map.Broadcast(5, $"Players with regeneration will heal every {healTime} seconds!");
            }
            response = $"Players with regeneration will heal every {healTime} seconds";
            return(true);
        }
Example #24
0
        /// <inheritdoc/>
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ep.addgroup"))
            {
                response = "You can't add a new group, you don't have \"ep.addgroup\" permission.";
                return(false);
            }

            if (arguments.Count == 1)
            {
                Permissions.Reload();

                if (Permissions.Groups.ContainsKey(arguments.At(0)))
                {
                    response = $"Group {arguments.At(0)} already exists.";
                    return(false);
                }

                Permissions.Groups.Add(arguments.At(0), new Features.Group());
                Permissions.Save();

                response = $"Group {arguments.At(0)} has been added.";
                return(true);
            }
            else
            {
                response = "EP GROUPS ADD <NAME>";
                return(false);
            }
        }
Example #25
0
        public override void OnLoad(ISynapseObject synapseObject, ArraySegment <string> args)
        {
            if (!(synapseObject is SynapseDoorObject door))
            {
                return;
            }
            if (args.Count == 0 || !int.TryParse(args.At(0), out var leftschematicID) || !SchematicHandler.Get.IsIDRegistered(leftschematicID))
            {
                return;
            }

            var leftDoor      = door.GameObject.transform.GetChild(2).GetChild(1).GetChild(0);
            var leftschematic = SchematicHandler.Get.SpawnSchematic(leftschematicID, leftDoor.transform.position);

            leftschematic.GameObject.transform.parent = leftDoor.transform;

            if (door.DoorType != Enum.SpawnableDoorType.EZ)
            {
                if (args.Count < 2 || !int.TryParse(args.At(1), out var righttschematicID) || !SchematicHandler.Get.IsIDRegistered(righttschematicID))
                {
                    return;
                }

                var rightDoor      = door.GameObject.transform.GetChild(2).GetChild(1).GetChild(1);
                var rightschematic = SchematicHandler.Get.SpawnSchematic(righttschematicID, rightDoor.transform.position);
                rightschematic.GameObject.transform.parent = rightDoor.transform;
            }
        }
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!((CommandSender)sender).CheckPermission("fctrl.killzone"))
            {
                response = "Access denied.";
                return(false);
            }
            if (arguments.Count() < 1)
            {
                response = "Invalid format. Must be: \"killzone light/heavy/entrance/surface (eg. killzone light)";
                return(false);
            }
            if (arguments.At(0).ToLower() != "light" && arguments.At(0).ToLower() != "heavy" && arguments.At(0).ToLower() != "entrance" && arguments.At(0).ToLower() != "surface")
            {
                response = "First argument must be light, heavy, entrance, or surface";
                return(false);
            }
            ZoneType zone        = (arguments.At(0).ToLower() == "light" ? ZoneType.LightContainment : (arguments.At(0).ToLower() == "heavy" ? ZoneType.HeavyContainment : (arguments.At(0).ToLower() == "entrance" ? ZoneType.Entrance : (arguments.At(0).ToLower() == "surface" ? ZoneType.Surface : ZoneType.Unspecified))));
            int      totalKilled = 0;

            foreach (Player Ply in Player.List)
            {
                if (Ply.CurrentRoom.Zone == zone && !Ply.IsGodModeEnabled)
                {
                    Ply.Hurt(99999, DamageTypes.Wall, "ZONEKILL");
                    totalKilled++;
                }
            }
            response = $"Killed {totalKilled} players in {zone.ToString()}";
            return(true);
        }
Example #27
0
        public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ct.locate"))
            {
                response = "You do not have permission to run this command! Missing permission: \"ct.locate\"";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage: locate room (player id / name)";
                return(false);
            }

            Player ply = Player.Get(arguments.At(0));

            if (ply == null)
            {
                response = $"Player \"{arguments.At(0)}\" not found";
                return(false);
            }

            response = $"Player \"{ply.Nickname}\" is located at room: {ply.CurrentRoom.Name}";
            return(true);
        }
Example #28
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (arguments.Count != 1)
            {
                response = "Usage: id ((player id / name) or (all / *))";
                return(false);
            }

            switch (arguments.At(0))
            {
            case "*":
            case "all":
                StringBuilder Builder = StringBuilderPool.Shared.Rent();
                if (Player.List.Count() == 0)
                {
                    Builder.AppendLine("There are no players currently online in the server");
                    string msg = Builder.ToString();
                    StringBuilderPool.Shared.Return(Builder);
                    response = msg;
                    return(true);
                }
                else
                {
                    Builder.AppendLine("List of ID's on the server:");
                    foreach (Player Ply in Player.List)
                    {
                        Builder.Append(Ply.Nickname);
                        Builder.Append(" - ");
                        Builder.Append(Ply.UserId);
                        Builder.Append(" - ");
                        Builder.AppendLine(Ply.Id.ToString());
                    }
                    string msg = Builder.ToString();
                    StringBuilderPool.Shared.Return(Builder);
                    response = msg;
                    return(true);
                }

            default:
                Player Pl;
                if (String.IsNullOrWhiteSpace(arguments.At(0)))
                {
                    Pl = Player.Get(((CommandSender)sender).ReferenceHub);
                }
                else
                {
                    Pl = Player.Get(arguments.At(0));
                    if (Pl == null)
                    {
                        response = "Player not found";
                        return(false);
                    }
                }

                response = $"{Pl.Nickname} - {Pl.UserId} - {Pl.Id}";
                return(true);
            }
        }
Example #29
0
        /// <inheritdoc/>
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            if (!(sender as CommandSender).CheckPermission("ep.groupinfo"))
            {
                response = "You can't see group information, you don't have \"ep.groupinfo\" permission.";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "- EP GROUPS <NAME>";
                return(false);
            }

            if (!Permissions.Groups.ContainsKey(arguments.At(0)))
            {
                response = $"Group {arguments.At(0)} does not exist.";
                return(false);
            }

            Permissions.Groups.TryGetValue(arguments.At(0), out Features.Group group);

            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine($"Group: {arguments.At(0)}");

            if (group == null)
            {
                stringBuilder.AppendLine($"Group is null.");
                response = stringBuilder.ToString();
                return(false);
            }

            stringBuilder.AppendLine($"Default: {group.IsDefault}");

            if (group.Inheritance.Count != 0)
            {
                stringBuilder.AppendLine("Inheritance: ");

                foreach (string inheritance in group.Inheritance)
                {
                    stringBuilder.AppendLine("- " + inheritance);
                }
            }

            if (group.Inheritance.Count != 0)
            {
                stringBuilder.AppendLine("Permissions: ");

                foreach (string permission in group.Permissions)
                {
                    stringBuilder.AppendLine($"- {permission}");
                }
            }

            response = stringBuilder.ToString();

            return(true);
        }
Example #30
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            if (!((CommandSender)sender).CheckPermission("at.ghost"))
            {
                response = "You do not have permission to use this command";
                return(false);
            }

            if (arguments.Count != 1)
            {
                response = "Usage:\nghost ((player id / name) or (all / *))" +
                           "\nghost clear";
                return(false);
            }

            switch (arguments.At(0))
            {
            case "clear":
                foreach (Player Pl in Player.List)
                {
                    Pl.IsInvisible = false;
                }

                response = "Everyone is no longer invisible";
                return(true);

            case "*":
            case "all":
                foreach (Player Pl in Player.List)
                {
                    Pl.IsInvisible = true;
                }

                response = "Everyone is now invisible";
                return(true);

            default:
                Player Ply = Player.Get(arguments.At(0));
                if (Ply == null)
                {
                    response = $"Player not found: {arguments.At(0)}";
                    return(false);
                }

                if (!Ply.IsInvisible)
                {
                    Ply.IsInvisible = true;
                    response        = $"Player {Ply.Nickname} is now invisible";
                }
                else
                {
                    Ply.IsInvisible = false;
                    response        = $"Player {Ply.Nickname} is no longer invisible";
                }
                return(true);
            }
        }