fix hq
This commit is contained in:
@@ -109,7 +109,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
|
|
||||||
public static bool IsAlive(this Player player)
|
public static bool IsAlive(this Player player)
|
||||||
{
|
{
|
||||||
return !player.HasData("isDead") || (bool)player.GetData("isDead") == false;
|
return !player.HasData("isDead") || player.GetData<bool>("isDead") == false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static T GetServerData<T>(this Player player, string key, T defaultValue = default)
|
public static T GetServerData<T>(this Player player, string key, T defaultValue = default)
|
||||||
|
|||||||
@@ -81,9 +81,10 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
|
|
||||||
if (user != null && user.Wanteds > 0 && !Jailtime.ContainsKey(user.Id))
|
if (user != null && user.Wanteds > 0 && !Jailtime.ContainsKey(user.Id))
|
||||||
{
|
{
|
||||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers().Where(u => u.IsLoggedIn() && u.IsDuty())
|
foreach (var copPlayer in NAPI.Pools.GetAllPlayers().Where(u => u.IsLoggedIn() && u.IsDuty() && u.IsAlive()))
|
||||||
{
|
{
|
||||||
if (!copPlayer.HasData("isDead") || copPlayer.GetData<bool>("isDead") != true)
|
User copUser = copPlayer.GetUser(dbContext);
|
||||||
|
if (copUser.FactionId == 1 || copUser.FactionId == 3)
|
||||||
{
|
{
|
||||||
if (player.Position.DistanceTo(copPlayer.Position) < 5)
|
if (player.Position.DistanceTo(copPlayer.Position) < 5)
|
||||||
{
|
{
|
||||||
@@ -91,6 +92,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
user.AnnouncePlayerJailedIn();
|
user.AnnouncePlayerJailedIn();
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
Check_PutBehindBars(user);
|
Check_PutBehindBars(user);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user