Add changes
This commit is contained in:
@@ -11,6 +11,7 @@ using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Job
|
||||
{
|
||||
@@ -100,7 +101,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
private static void UpdateFare(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
foreach(var player in GetPlayerInJob())
|
||||
foreach (var player in GetPlayerInJob())
|
||||
{
|
||||
if (!player.HasData("hasPassager")) { player.SetData<bool>("hasPassager", false); continue; }
|
||||
int playerId = player.GetUser().Id;
|
||||
@@ -112,15 +113,15 @@ namespace ReallifeGamemode.Server.Job
|
||||
lastPositions[v.Handle] = v.Position;
|
||||
|
||||
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
|
||||
if (distance > 0.5) { ChatService.BroadcastAdmin($"Möglicher Cheater - {player.Name}", Database.AdminLevel.MAPPING); continue; }
|
||||
if (distance > 0.5) { ChatService.BroadcastAdmin($"Möglicher Cheater - {player.Name}", AdminLevel.MAPPING); continue; }
|
||||
if (!player.GetData<bool>("hasPassager")) continue;
|
||||
foreach (Player occupant in v.Occupants)
|
||||
{
|
||||
occupant.TriggerEvent("CLIENT:updateFare", JsonConvert.SerializeObject(distance));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user