code formatiert
This commit is contained in:
@@ -83,12 +83,13 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (targetId == 0) return;
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
if(player.HasData("hasPassager")){
|
||||
User target = dbContext.Users.Where(u => u.Id == targetId).FirstOrDefault();
|
||||
target.Handmoney -= amount;
|
||||
player.GetUser(dbContext).Wage += amount;
|
||||
dbContext.SaveChanges();
|
||||
//target.Player.TriggerEvent("SERVER:SET_HANDMONEY", target.Handmoney);
|
||||
if (player.HasData("hasPassager"))
|
||||
{
|
||||
User target = dbContext.Users.Where(u => u.Id == targetId).FirstOrDefault();
|
||||
target.Handmoney -= amount;
|
||||
player.GetUser(dbContext).Wage += amount;
|
||||
dbContext.SaveChanges();
|
||||
//target.Player.TriggerEvent("SERVER:SET_HANDMONEY", target.Handmoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,19 +112,19 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (!player.HasData("hasPassager")) { player.SetData<bool>("hasPassager", false); continue; }
|
||||
int playerId = player.GetUser().Id;
|
||||
if (player.IsInVehicle)
|
||||
{
|
||||
Vehicle v = player.Vehicle;
|
||||
Vector3 lastPosition = v.Position;
|
||||
if (lastPositions.ContainsKey(v.Handle)) lastPosition = lastPositions[v.Handle];
|
||||
lastPositions[v.Handle] = v.Position;
|
||||
|
||||
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
|
||||
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));
|
||||
}
|
||||
Vehicle v = player.Vehicle;
|
||||
Vector3 lastPosition = v.Position;
|
||||
if (lastPositions.ContainsKey(v.Handle)) lastPosition = lastPositions[v.Handle];
|
||||
lastPositions[v.Handle] = v.Position;
|
||||
|
||||
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
|
||||
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