GELD LOGS
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using GTANetworkAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
@@ -13,11 +14,16 @@ using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Services;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
|
||||
namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
internal class UserCommands : Script
|
||||
{
|
||||
private static readonly ILogger logger = LogManager.GetLogger<UserCommands>();
|
||||
|
||||
private const int SMS_PRICE = 5;
|
||||
|
||||
[Command("rent", "~m~rent stop")]
|
||||
public void CmdUserStopRent(Player player, String option = "")
|
||||
{
|
||||
@@ -113,13 +119,15 @@ namespace ReallifeGamemode.Server.Commands
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User user = player.GetUser(dbContext);
|
||||
if (user.BankAccount.Balance < 5)
|
||||
if (user.BankAccount.Balance < SMS_PRICE)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Dafür hast du nicht genug Geld auf deinem Bankkonto");
|
||||
return;
|
||||
}
|
||||
|
||||
user.BankAccount.Balance -= 5;
|
||||
logger.LogInformation("Player {0} sent a sms to {1} for {2} dollars", player.Name, target.Name, SMS_PRICE);
|
||||
|
||||
user.BankAccount.Balance -= SMS_PRICE;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user