bissl formattiert
This commit is contained in:
@@ -13,53 +13,53 @@ using ReallifeGamemode.Server.Extensions;
|
||||
namespace ReallifeGamemode.Server.Wanted
|
||||
{
|
||||
public class WantedEscapeTimer
|
||||
{
|
||||
public static Dictionary<int, int> waTimer { get; set; } = new Dictionary<int, int>(); //zeit in ms
|
||||
/*
|
||||
public static void WantedTimer()
|
||||
{
|
||||
public static Dictionary<int, int> waTimer { get; set; } = new Dictionary<int, int>(); //zeit in ms
|
||||
/*
|
||||
public static void WantedTimer()
|
||||
{
|
||||
//System.Timers.Timer timer = new System.Timers.Timer(2500);
|
||||
//timer.Start();
|
||||
//timer.Elapsed += Timer_Elapsed;
|
||||
}
|
||||
*/
|
||||
//System.Timers.Timer timer = new System.Timers.Timer(2500);
|
||||
//timer.Start();
|
||||
//timer.Elapsed += Timer_Elapsed;
|
||||
}
|
||||
*/
|
||||
|
||||
public static void ResetWantedTimeToElapse(Player client)
|
||||
{
|
||||
User user = client.GetUser();
|
||||
if (user.FactionId == 1 || user.FactionId == 3)
|
||||
return;
|
||||
public static void ResetWantedTimeToElapse(Player client)
|
||||
{
|
||||
User user = client.GetUser();
|
||||
if (user.FactionId == 1 || user.FactionId == 3)
|
||||
return;
|
||||
|
||||
waTimer[user.Id] = 300000;
|
||||
}
|
||||
waTimer[user.Id] = 300000;
|
||||
}
|
||||
|
||||
public static void Timer_Elapsed()
|
||||
public static void Timer_Elapsed()
|
||||
{
|
||||
foreach (var player in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
User user = player.GetUser();
|
||||
if (user != null && user.Wanteds > 0)
|
||||
{
|
||||
foreach (var player in NAPI.Pools.GetAllPlayers())
|
||||
if (!waTimer.ContainsKey(user.Id))
|
||||
ResetWantedTimeToElapse(player);
|
||||
|
||||
bool isNearCop = false;
|
||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
if (!playerCop.IsLoggedIn()) continue;
|
||||
|
||||
User cop = playerCop.GetUser();
|
||||
if (cop != null && (cop.FactionId == 1 || cop.FactionId == 3))
|
||||
{
|
||||
User user = player.GetUser();
|
||||
if (user != null && user.Wanteds > 0)
|
||||
{
|
||||
if (!waTimer.ContainsKey(user.Id))
|
||||
ResetWantedTimeToElapse(player);
|
||||
|
||||
bool isNearCop = false;
|
||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
if (!playerCop.IsLoggedIn()) continue;
|
||||
|
||||
User cop = playerCop.GetUser();
|
||||
if (cop != null && (cop.FactionId == 1 || cop.FactionId == 3))
|
||||
{
|
||||
if (cop.GetData<bool>("duty") && playerCop.Position.DistanceTo2D(player.Position) <= 500)
|
||||
{
|
||||
//Schriftzug 'abgetaucht' zerstören :(
|
||||
isNearCop = true;
|
||||
break;
|
||||
}
|
||||
//Hier abgetaucht schriftzug einfügen :)
|
||||
}
|
||||
}
|
||||
if (cop.GetData<bool>("duty") && playerCop.Position.DistanceTo2D(player.Position) <= 500)
|
||||
{
|
||||
//Schriftzug 'abgetaucht' zerstören :(
|
||||
isNearCop = true;
|
||||
break;
|
||||
}
|
||||
//Hier abgetaucht schriftzug einfügen :)
|
||||
}
|
||||
}
|
||||
|
||||
if (!waTimer.ContainsKey(user.Id))
|
||||
waTimer[user.Id] = 300000;
|
||||
@@ -95,10 +95,10 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
}
|
||||
}
|
||||
|
||||
if (!isNearCop)
|
||||
waTimer[user.Id] -= 2500;
|
||||
}
|
||||
}
|
||||
if (!isNearCop)
|
||||
waTimer[user.Id] -= 2500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user