Fix MedicTaskUpdate
This commit is contained in:
@@ -313,7 +313,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, index);
|
mp.events.callRemote("updateMedicTask", 0, tasks[index].Victim);
|
||||||
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(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
||||||
{
|
{
|
||||||
@@ -367,7 +367,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, index);
|
mp.events.callRemote("updateMedicTask", 1, tasks[index].Victim);
|
||||||
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(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
activeCheckpoint = mp.checkpoints.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 2), 3.0,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,27 +192,27 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
|||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("updateMedicTask")]
|
[RemoteEvent("updateMedicTask")]
|
||||||
public void UpdateMedicTasks(Player player, int type, int index)
|
public void UpdateMedicTasks(Player player, int type, string victim)
|
||||||
{
|
{
|
||||||
Player target = PlayerService.GetPlayerByNameOrId(ReviveTasks[index].Victim);
|
Player target = PlayerService.GetPlayerByNameOrId(victim);
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
var reviveTask = ReviveTasks.FirstOrDefault(t => t.Victim == victim);
|
||||||
ReviveTasks[index].MedicName = player.Name;
|
reviveTask.MedicName = player.Name;
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Reviveauftrag von " + ReviveTasks[index].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:
|
||||||
HealTasks[index].MedicName = player.Name;
|
var healTask = ReviveTasks.FirstOrDefault(t => t.Victim == victim);
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " hat den Healauftrag von " + ReviveTasks[index].Victim + " angenommen.", new List<int>() { 2 });
|
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.");
|
target.SendNotification("~w~Sanitäter~g~ " + player.Name + "~w~ hat deinen Auftrag angenommen.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
FireTasks[index].MedicName = player.Name;
|
//FireTasks[index].MedicName = player.Name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user