fix jailtime

This commit is contained in:
hydrant
2019-07-20 14:15:56 +02:00
parent 0a3efd8f63
commit 95e4241610

View File

@@ -48,9 +48,9 @@ namespace ReallifeGamemode.Server.Wanted
User cop = copClient.GetUser();
if (cop?.FactionId == 1 || cop?.FactionId == 3)
{
int jailTime = user.Wanteds * 54;
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(client.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
{
int jailTime = user.Wanteds * 54; ;
using (var dbContext = new DatabaseContext())
{
if (!client.HasData("isDead") || client.GetData("isDead") == false)
@@ -84,13 +84,11 @@ namespace ReallifeGamemode.Server.Wanted
client.Health = 100;
ChatService.SendMessage(client, "Du bist im Gefängnis für " + jailTime + " Sekunden.");
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde ins Gefängnis geliefert.", new List<int>() {1,3});
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde ins Gefängnis geliefert.", new List<int>() { 1, 3 });
}
}
}
}
public static void JailTimer()
{
System.Timers.Timer timer = new System.Timers.Timer(60000);