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

@@ -2,9 +2,11 @@
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using Microsoft.Extensions.Logging;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Log;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Services;
@@ -12,6 +14,7 @@ namespace ReallifeGamemode.Server.Util
{
class Rentcar : Script
{
private static readonly ILogger logger = LogManager.GetLogger<Rentcar>();
//In Sekunden
public static int PAY_TIMER = 180;
@@ -69,6 +72,7 @@ namespace ReallifeGamemode.Server.Util
{
User user = player.GetUser(dbContext);
user.BankAccount.Balance -= mapPlayerRentcarBill[player.Name].Item2;
logger.LogInformation("Player {0} cancelled a rent and payed {1} dollars", player.Name, mapPlayerRentcarBill[player.Name].Item2);
dbContext.SaveChanges();
}
@@ -105,9 +109,9 @@ namespace ReallifeGamemode.Server.Util
{
return;
}
player.TriggerEvent("BN_Show", "Fahrzeug seit ~b~" + (int)(time / 60) + "~w~ Minuten gemietet (Gesamtkosten: ~g~$~s~" + bill + ").");
mapPlayerRentcarBill[player.Name] = (mapPlayerRentcarBill[player.Name].Item1, bill);
mapPlayerRentcarBill[player.Name] = (mapPlayerRentcarBill[player.Name].Item1, bill);
}
[RemoteEvent("SERVER:rentcarBooked")]