Wanted: Bei Einsperren 6$ pro Wanted je an PD/FIB Kasse

This commit is contained in:
hydrant
2021-04-22 14:49:12 +02:00
parent b1337881a8
commit 1495cc0c87
3 changed files with 10 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ namespace ReallifeGamemode.Server.Extensions
player.Armor = armor;
}
public static void SetJailTime(this User user, bool killed)
public static void SetJailTime(this User user, bool killed, DatabaseContext dbContext)
{
if (user == null)
{
@@ -101,6 +101,13 @@ namespace ReallifeGamemode.Server.Extensions
time *= 2;
}
int factionMoney = user.Wanteds * 6;
var executiveFactions = dbContext.Factions.Where(f => f.Id == 1 || f.Id == 3);
foreach(var faction in executiveFactions)
{
faction.BankAccount.Balance += factionMoney;
}
user.Wanteds = 0;
user.JailTime = time;
}