@@ -5,16 +5,20 @@ using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using GTANetworkAPI;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
|
||||
namespace ReallifeGamemode.Server.Gangwar
|
||||
{
|
||||
public class Turf
|
||||
{
|
||||
private static readonly ILogger logger = LogManager.GetLogger<Turf>();
|
||||
|
||||
public int TurfID { get; set; }
|
||||
public string TurfName { get; set; }
|
||||
public int Color { get; set; }
|
||||
@@ -203,7 +207,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
public void enter(Player client)
|
||||
{
|
||||
User user = client.GetUser();
|
||||
if(user == null || user.FactionId == null)
|
||||
if (user == null || user.FactionId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -276,6 +280,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
a.TriggerEvent("CLIENT:loose");
|
||||
}
|
||||
ownerFaction.BankAccount.Balance += 15000;
|
||||
logger.LogInformation("Gang {0} successfully defended the turf {1} against gang {2} and gained {3} dollars", getOwner(), getAttacker(), 15000);
|
||||
}
|
||||
else if (getOwner() != FactionName)
|
||||
{
|
||||
@@ -292,6 +297,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
if (a != null)
|
||||
a.TriggerEvent("CLIENT:win");
|
||||
}
|
||||
logger.LogInformation("Gang {0} successfully took over the turf {1} from gang {2} and gained {3} dollars", getAttacker(), getOwner(), 10000);
|
||||
this.Owner = FactionName;
|
||||
attackerFaction.BankAccount.Balance += 10000;
|
||||
Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault();
|
||||
@@ -379,7 +385,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
{
|
||||
if (getOwner() == FactionName)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getAttacker()}");
|
||||
NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getAttacker()}");
|
||||
Att_Score += 1;
|
||||
}
|
||||
else if (getAttacker() == FactionName)
|
||||
|
||||
Reference in New Issue
Block a user