Änderung Busfahrer/Pilot Bugs fix siehe Forenbeitrag
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user