GELD LOGS

(cherry picked from commit a2db770316)
This commit is contained in:
hydrant
2021-05-15 03:14:37 +02:00
parent 3c63002c03
commit 7411fa02f3
22 changed files with 448 additions and 306 deletions

View File

@@ -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;

View File

@@ -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);