@@ -10,6 +10,7 @@ using ReallifeGamemode.Server.Core.Extensions;
|
||||
using System.Linq;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Common;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Managers
|
||||
{
|
||||
@@ -451,6 +452,8 @@ namespace ReallifeGamemode.Server.Core.Managers
|
||||
return;
|
||||
}
|
||||
|
||||
Log.LogInformation("Player {0} did a withdraw of {1} dollars from house {2}", player.Name, amount, house.Id);
|
||||
|
||||
user.BankAccount.Balance += amount;
|
||||
house.BankAccount.Balance -= amount;
|
||||
|
||||
|
||||
@@ -6,12 +6,13 @@ using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Core.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Menus
|
||||
{
|
||||
internal class PoliceDepartment : Script
|
||||
{
|
||||
|
||||
private const int WEAPONLICENSE_PRICE = 5000;
|
||||
|
||||
public PoliceDepartment()
|
||||
{
|
||||
@@ -40,13 +41,15 @@ namespace ReallifeGamemode.Server.Core.Menus
|
||||
|
||||
var account = user.BankAccount;
|
||||
|
||||
if (account.Balance < 5000)
|
||||
if (account.Balance < WEAPONLICENSE_PRICE)
|
||||
{
|
||||
player.SendMessage("Du hast nicht genug Geld auf der Bank (5.000$)!", ChatPrefix.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
account.Balance -= 5000;
|
||||
Log.LogInformation("Player {0} bought a weapon license for {1} dollars", player.Name);
|
||||
|
||||
account.Balance -= WEAPONLICENSE_PRICE;
|
||||
|
||||
player.SendMessage("Du hast den Waffenschein erfolgreich erworben.", ChatPrefix.Info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user