Пример #1
0
        public bool UnArrestPlayer(CSteamID player)
        {
            if (!IsPlayerContains(player))
            {
                return(false);
            }

            Player resultPlayer = GetPlayerBySteamId(player);

            bool ignoreLastPosition = JailTimePlugin.Instance.Configuration.Instance.IgnoreLastPlayerPosition;

            Vector3SE lastPosition       = resultPlayer.LastPositionBeforeArrest;
            Vector3SE spawnPointPosition = JailTimePlugin.Instance.Configuration.Instance.SpawnPointAfterArrest;

            UnturnedPlayer thisPlayer = UnturnedPlayer.FromCSteamID(player);

            if (ignoreLastPosition)
            {
                thisPlayer.Player.teleportToLocation(spawnPointPosition.GetVector3(), thisPlayer.Rotation);
            }
            else
            {
                thisPlayer.Player.teleportToLocation(lastPosition.GetVector3(), thisPlayer.Rotation);
            }

            RemovePlayer(resultPlayer.SteamId);
            return(true);
        }
Пример #2
0
        public int GetRandomCell(out Vector3SE cellPosition)
        {
            Random rand = new Random();

            int minCellCount = JailTimePlugin.Instance.Configuration.Instance.Cells.Min(c => c.Id);
            int cellsCount   = JailTimePlugin.Instance.Configuration.Instance.Cells.Count;

            int result = rand.Next(minCellCount, cellsCount);

            cellPosition = GetCellPositionById(result);
            return(result);
        }
Пример #3
0
        public void LoadDefaults()
        {
            IgnoreLastPlayerPosition     = false;
            BanArrestedReasonOnReconnect = "You were banned for disconnecting from the server while serving your sentence!";
            BanArrestedOnReconnect       = false;
            BanDurationOnReconnect       = 500;
            WalkDistance = 5;

            SpawnPointAfterArrest = new Vector3SE()
            {
                X = 0,
                Y = 0,
                Z = 0
            };
            Cells = new List <Cell>()
            {
                new Cell()
                {
                    Id       = 1,
                    Position = new Vector3SE(0, 0, 0)
                }
            };
        }
Пример #4
0
        public void LoadDefaults()
        {
            IgnoreLastPlayerPosition = false;

            BanArrestedReasonOnReconnect = "Вы были забанены за отключение от сервера, во время отбывания срока!";
            BanArrestedOnReconnect       = true;
            BanDurationOnReconnect       = 500;
            WalkDistance = 5;

            SpawnPointAfterArrest = new Vector3SE()
            {
                X = 1,
                Y = 1,
                Z = 1
            };
            Cells = new List <Cell>()
            {
                new Cell()
                {
                    Id       = 1,
                    Position = new Vector3SE(1, 2, 3)
                }
            };
        }
Пример #5
0
 public Cell(int id, Vector3SE position)
 {
     Id       = id;
     Position = position;
 }
Пример #6
0
 public void CreateCell(int id, Vector3SE position)
 {
     JailTimePlugin.Instance.Configuration.Instance.Cells.Add(new Cell(id, position));
 }