Änderung Busfahrer/Pilot Bugs fix siehe Forenbeitrag

This commit is contained in:
Mac_Slash
2020-05-04 03:04:44 +02:00
parent 4dd9afd355
commit 1937846fb2
16 changed files with 498 additions and 262 deletions

View File

@@ -1,5 +1,6 @@
using GTANetworkAPI;
using GTANetworkAPI;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using System.Linq;
/**
@@ -15,7 +16,17 @@ namespace ReallifeGamemode.Server.Events
[ServerEvent(Event.ResourceStop)]
public void OnResourceStop()
{
var users = NAPI.Pools.GetAllPlayers();
foreach (var player in NAPI.Pools.GetAllPlayers())
{
using (var dbContext = new DatabaseContext())
{
player.GetUser(dbContext).PositionX = player.Position.X;
player.GetUser(dbContext).PositionY = player.Position.Y;
player.GetUser(dbContext).PositionZ = player.Position.Z;
dbContext.SaveChanges();
}
}
var users = NAPI.Pools.GetAllPlayers();
foreach (Player user in users)
{