haus verkaufen droppt cash

This commit is contained in:
hydrant
2020-03-14 01:42:10 +01:00
parent 6ac3c67379
commit a7695a93bd

View File

@@ -114,7 +114,7 @@ namespace ReallifeGamemode.Server.Managers
}
houseLabels[house.Id] = NAPI.TextLabel.CreateTextLabel(text, house.Position, 10f, 1f, 0, new Color(255, 255, 255));
@@ -393,10 +393,15 @@ namespace ReallifeGamemode.Server.Managers
}
House house = GetHouseById(user.HouseId.Value, dbContext);
house.OwnerId = null;
user.HouseId = null;
var backMoney = (int)(house.Price * 0.4);
ChatService.SendMessage(player, "Du bekommst vom Hausverkauf ~g~" + backMoney.ToMoneyString() + "~s~ zurück.");
user.GetBankAccount(dbContext).Balance += backMoney;
dbContext.SaveChanges();
player.SendChatMessage("!{#81F7BE}* Du hast dein Haus verkauft.");