Feierabend
This commit is contained in:
@@ -273,6 +273,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
mp.events.call("destroyMedicTaskCheckpoint");
|
mp.events.call("destroyMedicTaskCheckpoint");
|
||||||
|
mp.events.callRemote("updateMedicTask", 1, activeTask.Victim, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -318,7 +319,7 @@ 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,
|
||||||
{
|
{
|
||||||
@@ -371,7 +372,7 @@ 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", 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,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
|
if (isRemoved)
|
||||||
|
{
|
||||||
|
reviveTask.MedicName = "none";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
reviveTask.MedicName = player.Name;
|
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 = HealTasks.FirstOrDefault(t => t.Victim == victim);
|
var healTask = HealTasks.FirstOrDefault(t => t.Victim == victim);
|
||||||
|
if (isRemoved)
|
||||||
|
{
|
||||||
|
healTask.MedicName = "none";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
healTask.MedicName = player.Name;
|
healTask.MedicName = player.Name;
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Healauftrag von " + victim + " angenommen.", new List<int>() { 2 });
|
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.");
|
target.SendNotification("~w~Sanitäter~g~ " + player.Name + "~w~ hat deinen Auftrag angenommen.");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
@@ -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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user