diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index fa4449a5..8ba7d69b 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -510,19 +510,20 @@ namespace ReallifeGamemode.Server.Events if (nearestjailPoint != null) { - int oStaatsfrak = NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 1).Count() + - NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 3).Count(); - if(oStaatsfrak > 0) - { - player.SendNotification("~y~[Info]~w~ Es sind genĂ¼gend Beamte online!"); - return; - } + int oStaatsfrak = NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsDuty() && p.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 1).Count() + + NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsDuty() && p.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 3).Count(); if (client.Wanteds <= 0) { player.SendNotification("~y~[Info]~w~ Du wirst nicht gesucht!"); return; } + + if (oStaatsfrak > 2) + { + player.SendNotification("~y~[Info]~w~ Es sind genĂ¼gend Beamte online!"); + return; + } client.SetJailTime(true, dbcontext); Jail.Check_PutBehindBars(client, JailInLocations.Outside); player.SendNotification("Du hast dich selbst eingeknastet"); diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 76479d30..5ff73870 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -112,6 +112,7 @@ namespace ReallifeGamemode.Server.Wanted user.SetJailTime(false, dbContext); user.SetBlipAndNametagColor(); user.AnnouncePlayerJailedIn(); + user.Wanteds = 0; dbContext.SaveChanges(); //HERE: Freilauf Check_PutBehindBars(user, JailInLocations.Outside);