add selbsteinknasten
This commit is contained in:
@@ -21,6 +21,7 @@ using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.WeaponDeal;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Event Key (Key.cs)
|
||||
@@ -241,6 +242,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
|
||||
AmmunationPoint nearestAmmunationPoint = PositionManager.AmmunationPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
RentcarPoint nearestRentcarPoint = PositionManager.rentcarPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
JailPoint nearestjailPoint = PositionManager.jailPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
|
||||
if (user?.FactionId != null)
|
||||
{
|
||||
@@ -502,6 +504,31 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
using var dbcontext = new DatabaseContext();
|
||||
|
||||
User client = player.GetUser(dbcontext);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (client.Wanteds <= 0)
|
||||
{
|
||||
player.SendNotification("~y~[Info]~w~ Du wirst nicht gesucht!");
|
||||
return;
|
||||
}
|
||||
client.SetJailTime(true, dbcontext);
|
||||
Jail.Check_PutBehindBars(client, JailInLocations.Outside);
|
||||
player.SendNotification("Du hast dich selbst eingeknastet");
|
||||
ChatService.HQMessage(player.Name + " wurde ins Gefängnis eingeliefert.");
|
||||
}
|
||||
|
||||
//Rentcar Points
|
||||
if (nearestRentcarPoint != null)
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static List<CarwashPoint> carwashPoints = new List<CarwashPoint>();
|
||||
|
||||
public static List<JailPoint> jailPoints = new List<JailPoint>();
|
||||
|
||||
public static Vector3 eventportPosition;
|
||||
public static bool eventportActive = false;
|
||||
@@ -121,6 +122,25 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
#endregion WeaponPoints
|
||||
|
||||
#region JailPoints
|
||||
|
||||
JailPoint jail = new JailPoint()
|
||||
{
|
||||
Position = new Vector3(1854.06, 2582.38, 45.67)
|
||||
};
|
||||
|
||||
|
||||
jailPoints.Add(jail);
|
||||
|
||||
foreach (JailPoint j in jailPoints)
|
||||
{
|
||||
NAPI.Marker.CreateMarker(1, new Vector3(j.Position.X, j.Position.Y, j.Position.Z - 2), new Vector3(j.Position.X, j.Position.Y, j.Position.Z + 1),
|
||||
new Vector3(0, 0, 0), 1.5f, new Color(255, 255, 255, 0), false, 0);
|
||||
NAPI.TextLabel.CreateTextLabel("Stellen - Dr\u00fccke ~y~E", j.Position, 7, 1, 0, new Color(255, 255, 255), false, 0);
|
||||
}
|
||||
|
||||
#endregion JailReleasePoints
|
||||
|
||||
#region JailReleasePoints
|
||||
|
||||
JailReleasePoint jailPointLSPD = new JailReleasePoint()
|
||||
@@ -558,3 +578,8 @@ public class CarwashPoint
|
||||
public Vector3 Position { get; set; }
|
||||
}
|
||||
|
||||
public class JailPoint
|
||||
{
|
||||
public Vector3 Position { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -134,8 +134,10 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
if (user.JailTime <= 0)
|
||||
{
|
||||
Jailtime.Remove(user.Id);
|
||||
user.Wanteds = 0;
|
||||
player.SafeTeleport(JailOut_Point);
|
||||
player.TriggerEvent("jailTime", 0);
|
||||
dbContext.SaveChanges();
|
||||
return;
|
||||
}
|
||||
if (user.JailTime > 0)
|
||||
@@ -175,6 +177,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
player.GetUser(dbContext).JailTime = 0;
|
||||
player.GetUser(dbContext).Wanteds = 0;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
player.SafeSetHealth(100);
|
||||
@@ -195,6 +198,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
Jailtime.Remove(user.Id);
|
||||
|
||||
user.JailTime = 0;
|
||||
user.Wanteds = 0;
|
||||
dbContext.SaveChanges();
|
||||
|
||||
target.SafeSetHealth(100);
|
||||
|
||||
Reference in New Issue
Block a user