Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -36,7 +36,8 @@ export default function deathScreen() {
|
|||||||
deathDate = new Date();
|
deathDate = new Date();
|
||||||
respawnTime = Math.floor(deathDate.getTime() / 1000 + maxDeathTime);
|
respawnTime = Math.floor(deathDate.getTime() / 1000 + maxDeathTime);
|
||||||
fade = 255 - maxDeathTime;
|
fade = 255 - maxDeathTime;
|
||||||
mp.game.graphics.requestStreamedTextureDict("Mptattoos", true);
|
mp.game.graphics.requestStreamedTextureDict("Mptattoos", true);
|
||||||
|
mp.events.call("GetDutyMedics");
|
||||||
taskTimeout = false;
|
taskTimeout = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -272,7 +272,8 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
factionInteractionMenu.Close();
|
factionInteractionMenu.Close();
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
mp.events.call("destroyMedicTaskCheckpoint");
|
mp.events.callRemote("updateMedicTask", 1, activeTask.Victim, true);
|
||||||
|
mp.events.call("destroyMedicTaskCheckpoint");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -318,11 +319,10 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
} else {
|
} else {
|
||||||
if (tasks[index].MedicName === "none") {
|
if (tasks[index].MedicName === "none") {
|
||||||
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
||||||
mp.events.callRemote("updateMedicTask", 0, tasks[index].Victim);
|
mp.events.callRemote("updateMedicTask", 0, tasks[index].Victim, false);
|
||||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||||
activeCheckpoint = mp.checkpoints.new(4, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(4, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
||||||
{
|
{
|
||||||
direction: new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 5),
|
|
||||||
color: [255, 0, 0, 150],
|
color: [255, 0, 0, 150],
|
||||||
visible: true,
|
visible: true,
|
||||||
dimension: 0
|
dimension: 0
|
||||||
@@ -357,7 +357,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
aTask1.SetRightLabel(mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, tasks[i].Position.x, tasks[i].Position.y, tasks[i].Position.z, true).toFixed(2).toString() + " ~g~m");
|
aTask1.SetRightLabel(mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, tasks[i].Position.x, tasks[i].Position.y, tasks[i].Position.z, true).toFixed(2).toString() + " ~g~m");
|
||||||
healTaskMenuMedic.AddItem(aTask1);
|
healTaskMenuMedic.AddItem(aTask1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let backItem1 = new UIMenuItem("Zur\u00fcck", "Zur\u00fcck zur Fraktionsinteraktion.");
|
let backItem1 = new UIMenuItem("Zur\u00fcck", "Zur\u00fcck zur Fraktionsinteraktion.");
|
||||||
@@ -370,13 +370,12 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
healTaskMenuMedic.Close();
|
healTaskMenuMedic.Close();
|
||||||
factionInteractionMenu.Visible = true;
|
factionInteractionMenu.Visible = true;
|
||||||
} else {
|
} else {
|
||||||
if (tasks[index].MedicName === "none") {
|
if (tasks[index].MedicName === "none" && tasks[index].Victim != mp.players.local.name) {
|
||||||
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
||||||
mp.events.callRemote("updateMedicTask", 1, tasks[index].Victim);
|
mp.events.callRemote("updateMedicTask", 1, tasks[index].Victim, false);
|
||||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||||
activeCheckpoint = mp.checkpoints.new(4, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(4, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
||||||
{
|
{
|
||||||
direction: new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 5),
|
|
||||||
color: [255, 0, 0, 150],
|
color: [255, 0, 0, 150],
|
||||||
visible: true,
|
visible: true,
|
||||||
dimension: 0
|
dimension: 0
|
||||||
@@ -430,17 +429,19 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
|
|
||||||
mp.events.add('updateHealCheckpoint', (xPos, yPos, zPos) => {
|
mp.events.add('updateHealCheckpoint', (xPos, yPos, zPos) => {
|
||||||
if (activeTask && activeTask.Type == 1) {
|
if (activeTask && activeTask.Type == 1) {
|
||||||
activeCheckpoint.destroy();
|
if (activeCheckpoint && mp.checkpoints.exists(activeCheckpoint)) {
|
||||||
activeCheckpoint = null;
|
activeCheckpoint.destroy();
|
||||||
activeCheckpoint = mp.checkpoints.new(4, new mp.Vector3(xPos, yPos, zPos - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(4, new mp.Vector3(xPos, yPos, zPos - 2), 3.0,
|
||||||
{
|
{
|
||||||
direction: new mp.Vector3(xPos, yPos, zPos - 5),
|
color: [255, 0, 0, 150],
|
||||||
color: [255, 0, 0, 150],
|
visible: true,
|
||||||
visible: true,
|
dimension: 0
|
||||||
dimension: 0
|
});
|
||||||
});
|
mp.game.ui.setNewWaypoint(xPos, yPos);
|
||||||
|
taskFinish.x = xPos;
|
||||||
mp.game.ui.setNewWaypoint(xPos, yPos);
|
taskFinish.y = yPos;
|
||||||
|
taskFinish.z = zPos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
if (target.GetData<bool>("duty") == true)
|
if (target.GetData<bool>("duty") == true)
|
||||||
{
|
{
|
||||||
target.SetData<bool>("duty", false);
|
target.SetData<bool>("duty", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
}
|
}
|
||||||
|
|
||||||
string adminPlayername = NAPI.Player.GetPlayerName(player);
|
string adminPlayername = NAPI.Player.GetPlayerName(player);
|
||||||
@@ -784,7 +784,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
if (target.GetData<bool>("duty") == true)
|
if (target.GetData<bool>("duty") == true)
|
||||||
{
|
{
|
||||||
target.SetData<bool>("duty", false);
|
target.SetData<bool>("duty", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
}
|
}
|
||||||
|
|
||||||
string adminPlayername = NAPI.Player.GetPlayerName(player);
|
string adminPlayername = NAPI.Player.GetPlayerName(player);
|
||||||
@@ -879,7 +879,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
if (target.GetData<bool>("duty") == true)
|
if (target.GetData<bool>("duty") == true)
|
||||||
{
|
{
|
||||||
target.SetData<bool>("duty", false);
|
target.SetData<bool>("duty", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
}
|
}
|
||||||
|
|
||||||
reason = Regex.Replace(reason, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
reason = Regex.Replace(reason, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
user.Dead = true;
|
user.Dead = true;
|
||||||
|
|
||||||
if (!player.HasData("reviveSperre"))
|
if (!player.HasData("reviveSperre") || !player.HasData("inGangWar") || player.GetData<bool>("SAdminduty") == true)
|
||||||
{
|
{
|
||||||
//MEDIC AUFTRAG
|
//MEDIC AUFTRAG
|
||||||
MedicTask reviveTask = new MedicTask()
|
MedicTask reviveTask = new MedicTask()
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
if (player.GetData<bool>("duty") == true)
|
if (player.GetData<bool>("duty") == true)
|
||||||
{
|
{
|
||||||
player.SetData<bool>("duty", false);
|
player.SetData<bool>("duty", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
player.TriggerEvent("toggleDutyMode", true);
|
player.TriggerEvent("toggleDutyMode", true);
|
||||||
if (player.GetUser().FactionId == 2) //Fire Department
|
if (player.GetUser().FactionId == 2) //Fire Department
|
||||||
{
|
{
|
||||||
Medic.UpdateDutyMedics(1);
|
Medic.UpdateDutyMedics();
|
||||||
}
|
}
|
||||||
switch (factionId)
|
switch (factionId)
|
||||||
{
|
{
|
||||||
@@ -336,7 +336,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
user.SetData("duty", false);
|
user.SetData("duty", false);
|
||||||
player.SendNotification("Du bist nun ~r~außer Dienst.");
|
player.SendNotification("Du bist nun ~r~außer Dienst.");
|
||||||
player.TriggerEvent("toggleDutyMode", false);
|
player.TriggerEvent("toggleDutyMode", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
||||||
}
|
}
|
||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
|
|||||||
@@ -209,23 +209,38 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
|||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("updateMedicTask")]
|
[RemoteEvent("updateMedicTask")]
|
||||||
public void UpdateMedicTasks(Player player, int type, string victim)
|
public void UpdateMedicTasks(Player player, int type, string victim, bool isRemoved)
|
||||||
{
|
{
|
||||||
Player target = PlayerService.GetPlayerByNameOrId(victim);
|
Player target = PlayerService.GetPlayerByNameOrId(victim);
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
var reviveTask = ReviveTasks.FirstOrDefault(t => t.Victim == victim);
|
var reviveTask = ReviveTasks.FirstOrDefault(t => t.Victim == victim);
|
||||||
reviveTask.MedicName = player.Name;
|
if (isRemoved)
|
||||||
|
{
|
||||||
|
reviveTask.MedicName = "none";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reviveTask.MedicName = player.Name;
|
||||||
|
}
|
||||||
|
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Reviveauftrag von " + victim + " angenommen.", new List<int>() { 2 });
|
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Reviveauftrag von " + victim + " angenommen.", new List<int>() { 2 });
|
||||||
target.SendNotification("~w~Sanitäter~g~ " + player.Name + "~w~ eilt zur Rettung.");
|
target.SendNotification("~w~Sanitäter~g~ " + player.Name + "~w~ eilt zur Rettung.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
var healTask = ReviveTasks.FirstOrDefault(t => t.Victim == victim);
|
var healTask = HealTasks.FirstOrDefault(t => t.Victim == victim);
|
||||||
healTask.MedicName = player.Name;
|
if (isRemoved)
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Healauftrag von " + victim + " angenommen.", new List<int>() { 2 });
|
{
|
||||||
target.SendNotification("~w~Sanitäter~g~ " + player.Name + "~w~ hat deinen Auftrag angenommen.");
|
healTask.MedicName = "none";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
healTask.MedicName = player.Name;
|
||||||
|
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Healauftrag von " + victim + " angenommen.", new List<int>() { 2 });
|
||||||
|
target.SendNotification("~w~Sanitäter~g~ " + player.Name + "~w~ hat deinen Auftrag angenommen.");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@@ -273,10 +288,11 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
|||||||
RemoveTaskFromList(task);
|
RemoveTaskFromList(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[RemoteEvent("GetDutyMedics")]
|
||||||
public static void UpdateDutyMedics(int modifier)
|
public static void UpdateDutyMedics()
|
||||||
{
|
{
|
||||||
dutyMedics = dutyMedics + modifier;
|
|
||||||
|
dutyMedics = NAPI.Pools.GetAllPlayers().Where(c => c.GetData<bool>("duty") == true && c.GetUser().FactionId == 2).ToList().Count;
|
||||||
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", dutyMedics);
|
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", dutyMedics);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,81 +133,73 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
|
|
||||||
private void update()
|
private void update()
|
||||||
{
|
{
|
||||||
#region Ticket system
|
NAPI.Task.Run(() =>
|
||||||
|
|
||||||
/*
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == this.Owner).ToArray();
|
foreach (Player gangwarPlayer in this.playerInGangwar)
|
||||||
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == this.Attacker).ToArray();
|
|
||||||
}catch(NullReferenceException ex)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
foreach(var c in playerInGangwar)
|
|
||||||
{
|
{
|
||||||
if (!NAPI.Entity.DoesEntityExist(c.Handle))
|
if (!gangwarPlayer.IsLoggedIn())
|
||||||
{
|
{
|
||||||
this.playerInside = this.playerInside.Where(gp => gp != c).ToArray();
|
continue;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
|
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 900 - timerCount);
|
||||||
}
|
}
|
||||||
}
|
/*if (this.Att_Score >= 200)
|
||||||
if (owners.Length > attackers.Length)
|
|
||||||
this.Att_Score -= owners.Length - attackers.Length;
|
|
||||||
if(owners.Length < attackers.Length)
|
|
||||||
this.Def_Score -= attackers.Length - owners.Length;
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endregion Ticket system
|
|
||||||
|
|
||||||
foreach (Player gangwarPlayer in this.playerInGangwar)
|
|
||||||
{
|
|
||||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 900 - timerCount);
|
|
||||||
}
|
|
||||||
/*if (this.Att_Score >= 200)
|
|
||||||
{
|
|
||||||
this.takeOver(this.Attacker);
|
|
||||||
}
|
|
||||||
else if (this.Def_Score >= 200)
|
|
||||||
{
|
|
||||||
this.takeOver(this.Owner);
|
|
||||||
}*/
|
|
||||||
timerCount += 1;
|
|
||||||
if (timerCount >= 10) //change to 900 (seconds) before release for testing reasons change to whatever you like
|
|
||||||
{
|
|
||||||
if (this.Att_Score > this.Def_Score)
|
|
||||||
{
|
{
|
||||||
foreach (Player gangwarPlayer in this.playerInGangwar)
|
|
||||||
{
|
|
||||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
|
|
||||||
}
|
|
||||||
this.takeOver(this.Attacker);
|
this.takeOver(this.Attacker);
|
||||||
this.Def_Score = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (this.Att_Score < this.Def_Score)
|
else if (this.Def_Score >= 200)
|
||||||
{
|
{
|
||||||
foreach (Player gangwarPlayer in this.playerInGangwar)
|
|
||||||
{
|
|
||||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
|
|
||||||
}
|
|
||||||
this.takeOver(this.Owner);
|
this.takeOver(this.Owner);
|
||||||
this.Att_Score = 0;
|
}*/
|
||||||
return;
|
timerCount += 1;
|
||||||
}
|
if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like
|
||||||
else if (this.Def_Score == this.Att_Score)
|
|
||||||
{
|
{
|
||||||
foreach (Player gangwarPlayer in this.playerInGangwar)
|
if (this.Att_Score > this.Def_Score)
|
||||||
{
|
{
|
||||||
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
|
foreach (Player gangwarPlayer in this.playerInGangwar)
|
||||||
|
{
|
||||||
|
if (!gangwarPlayer.IsLoggedIn())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
|
||||||
|
}
|
||||||
|
this.takeOver(this.Attacker);
|
||||||
|
this.Def_Score = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (this.Att_Score < this.Def_Score)
|
||||||
|
{
|
||||||
|
foreach (Player gangwarPlayer in this.playerInGangwar)
|
||||||
|
{
|
||||||
|
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
|
||||||
|
}
|
||||||
|
this.takeOver(this.Owner);
|
||||||
|
this.Att_Score = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (this.Def_Score == this.Att_Score)
|
||||||
|
{
|
||||||
|
foreach (Player gangwarPlayer in this.playerInGangwar)
|
||||||
|
{
|
||||||
|
if (!gangwarPlayer.IsLoggedIn())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0, 0);
|
||||||
|
}
|
||||||
|
this.takeOver(this.Owner);
|
||||||
|
this.Def_Score = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this.takeOver(this.Owner);
|
|
||||||
this.Def_Score = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void enter(Player client)
|
public void enter(Player client)
|
||||||
{
|
{
|
||||||
User user = client.GetUser();
|
User user = client.GetUser();
|
||||||
@@ -215,7 +207,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
{
|
{
|
||||||
if (user.Faction.Name != getOwner() && user.Faction.Name != getAttacker())
|
if (user.Faction.Name != getOwner() && user.Faction.Name != getAttacker())
|
||||||
return;
|
return;
|
||||||
Player gPlayer = playerInGangwar.Where(c => c != null && !c.Handle.IsNull && c.IsLoggedIn() && c.GetUser().Id == user.Id).FirstOrDefault();
|
Player gPlayer = playerInGangwar.Where(c => c != null && !c.Handle.IsNull && c.IsLoggedIn() && c.GetUser()?.Id == user.Id).FirstOrDefault();
|
||||||
if (gPlayer == null)
|
if (gPlayer == null)
|
||||||
{
|
{
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
@@ -257,13 +249,11 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
|
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
|
||||||
foreach (var o in owners)
|
foreach (var o in owners)
|
||||||
{
|
{
|
||||||
if (o != null)
|
o.TriggerEvent("CLIENT:win");
|
||||||
o.TriggerEvent("CLIENT:win");
|
|
||||||
}
|
}
|
||||||
foreach (var a in attackers)
|
foreach (var a in attackers)
|
||||||
{
|
{
|
||||||
if (a != null)
|
a.TriggerEvent("CLIENT:loose");
|
||||||
a.TriggerEvent("CLIENT:loose");
|
|
||||||
}
|
}
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault());
|
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault());
|
||||||
@@ -272,15 +262,8 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
else if (getOwner() != FactionName)
|
else if (getOwner() != FactionName)
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
|
||||||
Console.WriteLine("[DEBUG:GANGWAR] getting owners...");
|
|
||||||
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
|
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
|
||||||
Console.WriteLine($"[DEBUG:GANGWAR] got owners {owners}.");
|
|
||||||
Console.WriteLine($"[DEBUG:GANGWAR] got owners {owners.ToString()}.");
|
|
||||||
|
|
||||||
Console.WriteLine("[DEBUG:GANGWAR] getting attackers...");
|
|
||||||
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
|
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
|
||||||
Console.WriteLine($"[DEBUG:GANGWAR] got attackers {attackers}.");
|
|
||||||
Console.WriteLine($"[DEBUG:GANGWAR] got attackers {attackers.ToString()}.");
|
|
||||||
foreach (var o in owners)
|
foreach (var o in owners)
|
||||||
{
|
{
|
||||||
if (o != null)
|
if (o != null)
|
||||||
@@ -303,6 +286,11 @@ namespace ReallifeGamemode.Server.Gangwar
|
|||||||
this.Attacker = null;
|
this.Attacker = null;
|
||||||
foreach (var c in playerInGangwar)
|
foreach (var c in playerInGangwar)
|
||||||
{
|
{
|
||||||
|
if (!c.IsLoggedIn())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
c.TriggerEvent("CLIENT:setAttackBlip", false, TurfID);
|
c.TriggerEvent("CLIENT:setAttackBlip", false, TurfID);
|
||||||
c.ResetData("inGangWar");
|
c.ResetData("inGangWar");
|
||||||
c.ResetData("GotInsideOfTurf");
|
c.ResetData("GotInsideOfTurf");
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
target.SetData("duty", false);
|
target.SetData("duty", false);
|
||||||
target.TriggerEvent("toggleDutyMode", false);
|
target.TriggerEvent("toggleDutyMode", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
UpdateCharacterCloth.LoadCharacterDefaults(target);
|
UpdateCharacterCloth.LoadCharacterDefaults(target);
|
||||||
target.GetUser(dbContext).FactionRankId = null;
|
target.GetUser(dbContext).FactionRankId = null;
|
||||||
target.GetUser(dbContext).FactionId = null;
|
target.GetUser(dbContext).FactionId = null;
|
||||||
@@ -834,6 +834,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
Medic.AddTaskToList(healTask);
|
Medic.AddTaskToList(healTask);
|
||||||
player.SetData("healauftrag", true);
|
player.SetData("healauftrag", true);
|
||||||
|
player.SendNotification("~w~Du hast einen Sanitäter um Hilfe gerufen");
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat soeben einen Serviceauftrag beantragt.", new List<int>() { 2 });
|
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat soeben einen Serviceauftrag beantragt.", new List<int>() { 2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
if (player.GetData<bool>("duty") == true)
|
if (player.GetData<bool>("duty") == true)
|
||||||
{
|
{
|
||||||
player.SetData<bool>("duty", false);
|
player.SetData<bool>("duty", false);
|
||||||
Medic.UpdateDutyMedics(-1);
|
Medic.UpdateDutyMedics();
|
||||||
}
|
}
|
||||||
|
|
||||||
var userClothes = dbContext.CharacterClothes.Where(c => c.UserId == user.Id && c.Duty == true);
|
var userClothes = dbContext.CharacterClothes.Where(c => c.UserId == user.Id && c.Duty == true);
|
||||||
|
|||||||
Reference in New Issue
Block a user