Fixes
This commit is contained in:
@@ -4,6 +4,7 @@ using ReallifeGamemode.Server.Extensions;
|
|||||||
using ReallifeGamemode.Server.Factions.Medic;
|
using ReallifeGamemode.Server.Factions.Medic;
|
||||||
using ReallifeGamemode.Server.Models;
|
using ReallifeGamemode.Server.Models;
|
||||||
using ReallifeGamemode.Server.Services;
|
using ReallifeGamemode.Server.Services;
|
||||||
|
using ReallifeGamemode.Server.Wanted;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
@@ -278,11 +279,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
User targetUser = target.GetUser();
|
User targetUser = target.GetUser();
|
||||||
if (targetUser.JailTime > 0)
|
if (targetUser.JailTime > 0)
|
||||||
{
|
{
|
||||||
using (var dbContext = new DatabaseContext())
|
Jail.Release_Jail(target, reason);
|
||||||
{
|
|
||||||
target.GetUser(dbContext).JailTime = 0;
|
|
||||||
dbContext.SaveChanges();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -106,13 +106,13 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
foreach(var copPlayer in NAPI.Pools.GetAllPlayers())
|
foreach(var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||||
{
|
{
|
||||||
User copUser = copPlayer.GetUser();
|
User copUser = copPlayer.GetUser();
|
||||||
if((copUser.FactionId == 1 || copUser.FactionId == 2) && cop != null)
|
if((copUser.FactionId == 1 || copUser.FactionId == 3) && cop != null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: Straftat gemeldet von" + cop + " - " + reason + ". Straftäter: "+ user.Name + ".");
|
ChatService.SendMessage(copPlayer, "~r~HQ: Straftat gemeldet von" + cop.Name + ". Grund: " + reason + ". Straftäter: "+ user.Name + ".");
|
||||||
}
|
}
|
||||||
else if((copUser.FactionId == 1 || copUser.FactionId == 2) && cop == null)
|
else if((copUser.FactionId == 1 || copUser.FactionId == 3) && cop == null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: " + user.Name + " hat eine Straftat begangen - " + reason + ".");
|
ChatService.SendMessage(copPlayer, "~r~HQ: " + user.Name + " hat eine Straftat begangen. Grund: " + reason + ".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using ReallifeGamemode.Server.Entities;
|
|||||||
using ReallifeGamemode.Server.Extensions;
|
using ReallifeGamemode.Server.Extensions;
|
||||||
using ReallifeGamemode.Server.Factions.Medic;
|
using ReallifeGamemode.Server.Factions.Medic;
|
||||||
using ReallifeGamemode.Server.Models;
|
using ReallifeGamemode.Server.Models;
|
||||||
|
using ReallifeGamemode.Server.Services;
|
||||||
|
|
||||||
namespace ReallifeGamemode.Server.Wanted
|
namespace ReallifeGamemode.Server.Wanted
|
||||||
{
|
{
|
||||||
@@ -39,7 +40,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
User cop = copClient.GetUser();
|
User cop = copClient.GetUser();
|
||||||
if (cop?.FactionId == 1 || cop?.FactionId == 3)
|
if (cop?.FactionId == 1 || cop?.FactionId == 3)
|
||||||
{
|
{
|
||||||
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(copClient.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
|
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(client.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
|
||||||
{
|
{
|
||||||
client.SetData("isDead", false);
|
client.SetData("isDead", false);
|
||||||
client.RemoveAllWeapons();
|
client.RemoveAllWeapons();
|
||||||
@@ -160,5 +161,32 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void Release_Jail(Client player, string reason)
|
||||||
|
{
|
||||||
|
User user = player.GetUser();
|
||||||
|
if (Jailtime.ContainsKey(user.Id))
|
||||||
|
{
|
||||||
|
|
||||||
|
Jailtime.Remove(user.Id);
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
player.GetUser(dbContext).JailTime = 0;
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
}
|
||||||
|
player.Health = 100;
|
||||||
|
player.Position = new Vector3(461.7256, -988.6035, 24.91487);
|
||||||
|
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||||
|
{
|
||||||
|
User copUser = copPlayer.GetUser();
|
||||||
|
if ((copUser.FactionId == 1 || copUser.FactionId == 3))
|
||||||
|
{
|
||||||
|
ChatService.SendMessage(copPlayer, "~r~HQ: Beamter " + copPlayer.Name + " hat " + user.Name + " aus dem Knast entlassen. Grund: " + reason + ".");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user