diff --git a/ReallifeGamemode.Server/Extensions/IntegerExtension.cs b/ReallifeGamemode.Server/Extensions/IntegerExtension.cs index 6a62a509..743f06ad 100644 --- a/ReallifeGamemode.Server/Extensions/IntegerExtension.cs +++ b/ReallifeGamemode.Server/Extensions/IntegerExtension.cs @@ -11,5 +11,10 @@ { return "$" + string.Format(Main.SERVER_CULTURE, "{0:C0}", money).Replace("€", "").Trim(); } + + public static string ToMoneyString(this double money) + { + return ((int)money).ToMoneyString(); + } } } diff --git a/ReallifeGamemode.Server/Managers/BusinessManager.cs b/ReallifeGamemode.Server/Managers/BusinessManager.cs index 875d3c9a..77ad2d06 100644 --- a/ReallifeGamemode.Server/Managers/BusinessManager.cs +++ b/ReallifeGamemode.Server/Managers/BusinessManager.cs @@ -19,6 +19,8 @@ namespace ReallifeGamemode.Server.Managers { public static List Businesses { get; private set; } + private const double FACTION_CAR_MULTIPLIER = 1.5; + public static void LoadBusinesses() { Businesses = new List(); @@ -199,10 +201,10 @@ namespace ReallifeGamemode.Server.Managers else if (target == "Fraktion") { var faction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == u.FactionId).First(); - TransactionResult result = BankManager.TransferMoney(faction, business, price * 3, "Auto gekauft", dbContext); + TransactionResult result = BankManager.TransferMoney(faction, business, (int)(price * FACTION_CAR_MULTIPLIER), "Auto gekauft", dbContext); if (result == TransactionResult.SENDER_NOT_ENOUGH_MONEY) { - player.SendNotification("~r~Die Fraktion hat nicht genug Geld: " + (price * 3).ToMoneyString()); + player.SendNotification("~r~Die Fraktion hat nicht genug Geld: " + (price * FACTION_CAR_MULTIPLIER).ToMoneyString()); return; } player.SendChatMessage("~y~Deine Fraktion hat das Fahrzeug erfolgreich gekauft");