handmoney fix

This commit is contained in:
hydrant
2020-04-19 19:24:16 +02:00
parent a31ced3217
commit e6f3399910
2 changed files with 19 additions and 2 deletions

View File

@@ -21,6 +21,9 @@ namespace ReallifeGamemode.Database.Entities
[NotMapped] [NotMapped]
private int _wanteds; private int _wanteds;
[NotMapped]
private int _handMoney;
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; } public int Id { get; set; }
@@ -40,7 +43,16 @@ namespace ReallifeGamemode.Database.Entities
public AdminLevel AdminLevel { get; set; } public AdminLevel AdminLevel { get; set; }
public bool Dead { get; set; } public bool Dead { get; set; }
public int Handmoney { get; set; } public int Handmoney
{
get => _handMoney;
set
{
_handMoney = value;
Player.TriggerEvent("SERVER:SET_HANDMONEY", value);
}
}
public float PositionX { get; set; } public float PositionX { get; set; }
public float PositionY { get; set; } public float PositionY { get; set; }

View File

@@ -210,8 +210,13 @@ namespace ReallifeGamemode.Server.Managers
//Alle Spieler //Alle Spieler
foreach (Player player in NAPI.Pools.GetAllPlayers()) foreach (Player player in NAPI.Pools.GetAllPlayers())
{ {
Vector3 pos = player.Position;
User user = player.GetUser(saveAll); User user = player.GetUser(saveAll);
if (user == null)
{
continue;
}
Vector3 pos = player.Position;
user.PositionX = pos.X; user.PositionX = pos.X;
user.PositionY = pos.Y; user.PositionY = pos.Y;
user.PositionZ = pos.Z; user.PositionZ = pos.Z;