add auch beim ausslogen position speichern
This commit is contained in:
@@ -195,11 +195,30 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
user.PositionX = pos.X;
|
||||
user.PositionY = pos.Y;
|
||||
user.PositionZ = pos.Z;
|
||||
user.PositionZ = pos.Z;
|
||||
saveUser.SaveChanges();
|
||||
user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false;
|
||||
|
||||
if (user.Wanteds > 0)
|
||||
if (player.IsInVehicle)
|
||||
{
|
||||
GTANetworkAPI.Vehicle vehicle = player.Vehicle;
|
||||
|
||||
ServerVehicle sV = vehicle.GetServerVehicle(saveUser);
|
||||
|
||||
if (sV is UserVehicle)
|
||||
{
|
||||
Vector3 pos1 = vehicle.Position;
|
||||
|
||||
sV.PositionX = pos1.X;
|
||||
sV.PositionY = pos1.Y;
|
||||
sV.PositionZ = pos1.Z;
|
||||
sV.Heading = vehicle.Heading;
|
||||
|
||||
saveUser.SaveChanges();
|
||||
}
|
||||
|
||||
}
|
||||
if (user.Wanteds > 0)
|
||||
{
|
||||
ChatService.HQMessage("Der Straftäter " + user.Name + " ist vom Radar verschwunden");
|
||||
}
|
||||
|
||||
@@ -281,6 +281,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
sV.PositionZ = pos.Z;
|
||||
sV.Heading = v.Heading;
|
||||
|
||||
|
||||
player.SendNotification("~g~Das Fahrzeug wurde geparkt.");
|
||||
|
||||
dbContext.SaveChanges();
|
||||
|
||||
Reference in New Issue
Block a user