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)
|
if (copNearby)
|
||||||
{
|
{
|
||||||
user.SetJailTime(true);
|
user.SetJailTime(true, dbContext);
|
||||||
Jail.Check_PutBehindBars(user);
|
Jail.Check_PutBehindBars(user);
|
||||||
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
player.Armor = armor;
|
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)
|
if (user == null)
|
||||||
{
|
{
|
||||||
@@ -101,6 +101,13 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
time *= 2;
|
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.Wanteds = 0;
|
||||||
user.JailTime = time;
|
user.JailTime = time;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
{
|
{
|
||||||
if (player.Position.DistanceTo(copPlayer.Position) < 5)
|
if (player.Position.DistanceTo(copPlayer.Position) < 5)
|
||||||
{
|
{
|
||||||
user.SetJailTime(false);
|
user.SetJailTime(false, dbContext);
|
||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
user.AnnouncePlayerJailedIn();
|
user.AnnouncePlayerJailedIn();
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|||||||
Reference in New Issue
Block a user