Wanted: Bei Einsperren 6$ pro Wanted je an PD/FIB Kasse
This commit is contained in:
@@ -146,7 +146,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
if (copNearby)
|
||||
{
|
||||
user.SetJailTime(true);
|
||||
user.SetJailTime(true, dbContext);
|
||||
Jail.Check_PutBehindBars(user);
|
||||
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
{
|
||||
if (player.Position.DistanceTo(copPlayer.Position) < 5)
|
||||
{
|
||||
user.SetJailTime(false);
|
||||
user.SetJailTime(false, dbContext);
|
||||
user.SetBlipAndNametagColor();
|
||||
user.AnnouncePlayerJailedIn();
|
||||
dbContext.SaveChanges();
|
||||
|
||||
Reference in New Issue
Block a user