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) if (nearestjailPoint != null)
{ {
int oStaatsfrak = NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 1).Count() + 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.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 3).Count(); NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsDuty() && p.IsLoggedIn() && p.GetUser(dbcontext).FactionId == 3).Count();
if(oStaatsfrak > 0)
{
player.SendNotification("~y~[Info]~w~ Es sind genügend Beamte online!");
return;
}
if (client.Wanteds <= 0) if (client.Wanteds <= 0)
{ {
player.SendNotification("~y~[Info]~w~ Du wirst nicht gesucht!"); player.SendNotification("~y~[Info]~w~ Du wirst nicht gesucht!");
return; return;
} }
if (oStaatsfrak > 2)
{
player.SendNotification("~y~[Info]~w~ Es sind genügend Beamte online!");
return;
}
client.SetJailTime(true, dbcontext); client.SetJailTime(true, dbcontext);
Jail.Check_PutBehindBars(client, JailInLocations.Outside); Jail.Check_PutBehindBars(client, JailInLocations.Outside);
player.SendNotification("Du hast dich selbst eingeknastet"); player.SendNotification("Du hast dich selbst eingeknastet");

View File

@@ -112,6 +112,7 @@ namespace ReallifeGamemode.Server.Wanted
user.SetJailTime(false, dbContext); user.SetJailTime(false, dbContext);
user.SetBlipAndNametagColor(); user.SetBlipAndNametagColor();
user.AnnouncePlayerJailedIn(); user.AnnouncePlayerJailedIn();
user.Wanteds = 0;
dbContext.SaveChanges(); dbContext.SaveChanges();
//HERE: Freilauf //HERE: Freilauf
Check_PutBehindBars(user, JailInLocations.Outside); Check_PutBehindBars(user, JailInLocations.Outside);