diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 19770a27..19bd1bbb 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -81,28 +81,28 @@ namespace ReallifeGamemode.Server.Wanted foreach (var player in NAPI.Pools.GetAllPlayers()) { User user = player.GetUser(); - if (jailtime.ContainsKey(user.Id)) - return; - foreach(var copPlayer in NAPI.Pools.GetAllPlayers()) + if (!jailtime.ContainsKey(user.Id)) { - User cop = copPlayer.GetUser(); - if (cop.GetData("duty") && copPlayer.Position.DistanceTo2D(player.Position) <= 500) + foreach (var copPlayer in NAPI.Pools.GetAllPlayers()) { - if (player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) <= 7) + User cop = copPlayer.GetUser(); + if (cop.GetData("duty") && copPlayer.Position.DistanceTo2D(player.Position) <= 500) { - if (player.Position.DistanceTo2D(copPlayer.Position) < 5) + if (player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) <= 7) { - Check_PutBehindBars(player); + if (player.Position.DistanceTo2D(copPlayer.Position) < 5) + { + Check_PutBehindBars(player); + } } + } } - - } + } } } - private static void brakeOut_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { foreach (var player in NAPI.Pools.GetAllPlayers()) @@ -133,26 +133,7 @@ namespace ReallifeGamemode.Server.Wanted if (user.JailTime <= 0) { - Random rnd = new Random(); - int rndInt = rnd.Next(1, 5); - switch (rndInt) - { - case 1: - player.Position = new Vector3(462.0074, -991.5361, 24.91487); - break; - case 2: - player.Position = new Vector3(462.2939, -989.9335, 24.91487); - break; - case 3: - player.Position = new Vector3(461.7256, -988.6035, 24.91487); - break; - case 4: - player.Position = new Vector3(462.5977, -989.9182, 24.91487); - break; - case 5: - player.Position = new Vector3(462.4364, -991.4973, 24.91487); - break; - } + player.Position = new Vector3(461.7256, -988.6035, 24.91487); jailtime.Remove(user.Id); return; } diff --git a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs index e1a92419..507c116a 100644 --- a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs +++ b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs @@ -38,7 +38,6 @@ namespace ReallifeGamemode.Server.Wanted waTimer[user.Id] = 300000; } - private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { foreach (var player in NAPI.Pools.GetAllPlayers())