changes something

This commit is contained in:
michael.reiswich
2021-05-25 21:04:35 +02:00
parent 7159485742
commit 5044c8e295
2 changed files with 9 additions and 7 deletions

View File

@@ -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");