[*] Fix Autojail on death.
+ Added HQ message for wanteds
This commit is contained in:
@@ -76,8 +76,6 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
//JailTime.cs
|
||||
Jail.Check_PutBehindBars(player);
|
||||
|
||||
|
||||
//MEDIC AUFTRAG
|
||||
@@ -115,6 +113,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
userDeath.DeathLogs.Add(dead);
|
||||
userDeath.SaveChanges();
|
||||
}
|
||||
//JailTime.cs
|
||||
Jail.Check_PutBehindBars(player);
|
||||
|
||||
}
|
||||
[RemoteEvent("RespawnPlayerAtHospital")]
|
||||
public void RespawnPlayerAtHospital(Client player)
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
{
|
||||
if (user.Wanteds + amount > 50)
|
||||
{
|
||||
ChatService.ErrorMessage(cop, "Die Wanteds dürfen ein Limit von 40 nicht überschreiten");
|
||||
ChatService.ErrorMessage(cop, "Die Wanteds dürfen ein Limit von 50 nicht überschreiten");
|
||||
return;
|
||||
}
|
||||
using (var dbContext = new DatabaseContext())
|
||||
@@ -103,6 +103,19 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
dbUser.Wanteds += amount;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
foreach(var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
User copUser = copPlayer.GetUser();
|
||||
if((copUser.FactionId == 1 || copUser.FactionId == 2) && cop != null)
|
||||
{
|
||||
ChatService.SendMessage(copPlayer, "~r~HQ: Straftat gemeldet von" + cop + " - " + reason + ". Straftäter: "+ user.Name + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
ChatService.SendMessage(copPlayer, "~r~HQ: " + user.Name + " hat eine Straftat begangen - " + reason + ".");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public static FactionRank GetFactionRank(this User user)
|
||||
{
|
||||
|
||||
@@ -13,8 +13,9 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
public static void Check_AutoWanted(Client killerPlayer, Client copPlayer)
|
||||
{
|
||||
User killer = killerPlayer.GetUser();
|
||||
if(killer.FactionId != 1 || killer.FactionId != 3)
|
||||
{
|
||||
if (killer.FactionId == 1 || killer.FactionId == 3)
|
||||
return;
|
||||
|
||||
User cop = copPlayer.GetUser();
|
||||
if(cop.FactionId == 1 || cop.FactionId == 3)
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,16 +37,18 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
User cop = copClient.GetUser();
|
||||
if (cop?.FactionId == 1 || cop?.FactionId == 3)
|
||||
{
|
||||
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(copClient.Position) <= 200)
|
||||
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(copClient.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
|
||||
{
|
||||
client.SetData("isDead", false);
|
||||
client.RemoveAllWeapons();
|
||||
Random rnd = new Random();
|
||||
int rndInt = rnd.Next(1, 3);
|
||||
if (rndInt == 1)
|
||||
client.Position = new Vector3(458.9842, -997.2126, 24.91485); //send client to jail
|
||||
NAPI.Player.SpawnPlayer(client, new Vector3(458.9842, -997.2126, 24.91485)); //send client to jail
|
||||
if (rndInt == 2)
|
||||
client.Position = new Vector3(459.696, -994.3766, 24.91486); //send client to jail
|
||||
NAPI.Player.SpawnPlayer(client, new Vector3(459.696, -994.3766, 24.91486)); //send client to jail
|
||||
if (rndInt == 3)
|
||||
client.Position = new Vector3(458.3372, -1001.258, 24.91485); //send client to jail
|
||||
NAPI.Player.SpawnPlayer(client, new Vector3(458.3372, -1001.258, 24.91485)); //send client to jail
|
||||
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
@@ -86,7 +88,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
User cop = copPlayer.GetUser();
|
||||
if (cop.GetData<bool>("duty") && copPlayer.Position.DistanceTo2D(player.Position) <= 500)
|
||||
if (cop.GetData<bool>("duty") && copPlayer.Position.DistanceTo2D(player.Position) <= 500 && (!copPlayer.HasData("isDead") || copPlayer.GetData("isDead") != true))
|
||||
{
|
||||
if (player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) <= 7)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user