示例#1
0
        public void cmd_nodamage(CommandInfo info)
        {
            string[]      arg    = info.commandArgs;
            CommandSender sender = info.commandSender;

            if (!CustomInternalCommands.CheckPermissions(sender, arg[0], PlayerPermissions.PlayersManagement))
            {
                return;
            }

            List <GameObject> playerList = CustomInternalCommands.GetPlayersFromString(arg[1]);

            foreach (GameObject player in playerList)
            {
                int id = player.GetComponent <RemoteAdmin.QueryProcessor>().PlayerId;

                if (!nodamageplayers.ContainsKey(id))
                {
                    nodamageplayers.Add(id, player);
                }
                else
                {
                    nodamageplayers.Remove(id);
                }
            }
        }
示例#2
0
        public void cmd_Drop(CommandInfo info)
        {
            try
            {
                string[] arg = info.commandArgs;

                if (!CustomInternalCommands.CheckPermissions(info.commandSender, arg[0], PlayerPermissions.PlayersManagement))
                {
                    return;
                }

                List <GameObject> playerList = CustomInternalCommands.GetPlayersFromString(arg[1]);

                foreach (GameObject p in playerList)
                {
                    p.GetComponent <Inventory>().ServerDropAll();
                }

                info.commandSender.RaReply(info.commandName.ToUpper() + $"#Player {(playerList.Count > 1 ? "inventories" : "inventory")} dropped", true, true, "");
            }
            catch (Exception e)
            {
                Base.Error(e.ToString());
            }
        }
示例#3
0
        public void cmd_PBC(CommandInfo info)
        {
            string[]      arg    = info.commandArgs;
            CommandSender sender = info.commandSender;

            if (!CustomInternalCommands.CheckPermissions(sender, arg[0], PlayerPermissions.Broadcasting))
            {
                return;
            }

            bool success = ushort.TryParse(arg[2], out ushort duration);

            if (arg.Count() < 4)
            {
                sender.RaReply(arg[0].ToUpper() + "#Command expects 3 or more arguments ([Players], [Seconds], [Message])", false, true, "");
                return;
            }
            else if (!success || duration < 1 || duration > 255)
            {
                sender.RaReply(arg[0].ToUpper() + "#Invalid duration given", false, true, "");
                return;
            }

            List <GameObject> playerList = CustomInternalCommands.GetPlayersFromString(arg[1]);

            string message = string.Join(" ", arg.Skip(3));

            foreach (GameObject player in playerList)
            {
                player.GetComponent <Broadcast>().TargetAddElement(player.GetComponent <NetworkConnection>(), message, duration, Broadcast.BroadcastFlags.Normal);
            }

            sender.RaReply(arg[0].ToUpper() + "Broadcast sent!", true, true, "");
        }
示例#4
0
        public void cmd_pocket(CommandInfo info)
        {
            List <GameObject> playerList = CustomInternalCommands.GetPlayersFromString(info.commandArgs[1]);

            foreach (GameObject plr in playerList)
            {
                plr.GetComponent <PlayerMovementSync>().OverridePosition(Vector3.down * 1998.5f, 0f, true);
            }

            info.commandSender.RaReply(info.commandName.ToUpper() + $"#Teleported {playerList.Count} {(playerList.Count == 1 ? "player" : "players")} to the pocket dimension", true, true, "");
        }
示例#5
0
        public void cmd_tower2(CommandInfo info)
        {
            List <GameObject> playerList = CustomInternalCommands.GetPlayersFromString(info.commandArgs[1]);

            foreach (GameObject plr in playerList)
            {
                plr.GetComponent <PlayerMovementSync>().OverridePosition(new Vector3(223, 1026, -18), 0);
            }

            info.commandSender.RaReply(info.commandName.ToUpper() + $"#Teleported {playerList.Count} {(playerList.Count == 1 ? "player" : "players")} to tower 2", true, true, "");
        }
示例#6
0
        public void cmd_Kill(CommandInfo info)
        {
            string[]      arg    = info.commandArgs;
            CommandSender sender = info.commandSender;

            if (!CustomInternalCommands.CheckPermissions(sender, arg[0], PlayerPermissions.PlayersManagement))
            {
                return;
            }

            List <GameObject> playerList = CustomInternalCommands.GetPlayersFromString(arg[1]);

            foreach (GameObject player in playerList)
            {
                player.GetComponent <PlayerStats>().HurtPlayer(new PlayerStats.HitInfo(9999f, sender.Nickname, DamageTypes.None, info.gameObject.GetComponent <RemoteAdmin.QueryProcessor>().PlayerId), player);
            }

            info.commandSender.RaReply(info.commandName.ToUpper() + $"#Killed {playerList.Count} {(playerList.Count > 1 ? "players" : "player")}", true, true, "");
        }