Nun aber
This commit is contained in:
@@ -18,8 +18,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
var sorting = 0;
|
||||
var firstSorting = true;
|
||||
var activeTask = null;
|
||||
var activeMarker: MarkerMp;
|
||||
var activeColshape: ColshapeMp;
|
||||
var activeCheckpoint: CheckpointMp;
|
||||
var taskStart;
|
||||
var taskFinish;
|
||||
var taskRange;
|
||||
@@ -235,7 +234,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
factionInteractionMenu.AddItem(fireTaskMenuMedic);
|
||||
*/
|
||||
if (activeTask != null) {
|
||||
if (activeTask.Type == 1 && activeColshape && mp.colshapes.exists(activeColshape)) {
|
||||
if (activeTask.Type == 1 && activeCheckpoint && mp.checkpoints.exists(activeCheckpoint)) {
|
||||
deleteCheckpointItem = new UIMenuItem("~r~Checkpoint löschen");
|
||||
factionInteractionMenu.AddItem(deleteCheckpointItem);
|
||||
}
|
||||
@@ -321,13 +320,12 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
||||
mp.events.callRemote("updateMedicTask", 0, tasks[index].Victim);
|
||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||
activeMarker = mp.markers.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 1), 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,
|
||||
{
|
||||
color: [255, 0, 0, 150],
|
||||
visible: true,
|
||||
dimension: 0
|
||||
});
|
||||
activeColshape = mp.colshapes.newTube(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 1, 2, 3, 0);
|
||||
reviveTaskMenuMedic.Close();
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.InMenu = false;
|
||||
@@ -375,13 +373,12 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
mp.game.graphics.requestStreamedTextureDict("medicimages", true);
|
||||
mp.events.callRemote("updateMedicTask", 1, tasks[index].Victim);
|
||||
mp.game.ui.setNewWaypoint(tasks[index].Position.x, tasks[index].Position.y);
|
||||
activeMarker = mp.markers.new(1, new mp.Vector3(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 1), 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,
|
||||
{
|
||||
color: [255, 0, 0, 150],
|
||||
visible: true,
|
||||
dimension: 0
|
||||
});
|
||||
activeColshape = mp.colshapes.newTube(tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z - 1, 2, 3, 0);
|
||||
healTaskMenuMedic.Close();
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.InMenu = false;
|
||||
@@ -405,27 +402,19 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add('playerEnterColshape', (activeColshape) => {
|
||||
mp.events.add('playerEnterCheckpoint', (activeCheckpoint) => {
|
||||
if (activeTask.Type == 1) {
|
||||
activeColshape.destroy();
|
||||
activeColshape = null;
|
||||
if (mp.markers.exists(activeMarker)) {
|
||||
activeMarker.destroy();
|
||||
activeMarker = null;
|
||||
}
|
||||
activeCheckpoint.destroy();
|
||||
activeCheckpoint = null;
|
||||
activeTask = null;
|
||||
timeLeft = null;
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("destroyMedicTaskCheckpoint", () => {
|
||||
if (activeColshape && mp.colshapes.exists(activeColshape)) {
|
||||
activeColshape.destroy();
|
||||
activeColshape = null;
|
||||
if (mp.markers.exists(activeMarker)) {
|
||||
activeMarker.destroy();
|
||||
activeMarker = null;
|
||||
}
|
||||
if (activeCheckpoint && mp.checkpoints.exists(activeCheckpoint)) {
|
||||
activeCheckpoint.destroy();
|
||||
activeCheckpoint = null;
|
||||
activeTask = null;
|
||||
timeLeft = null;
|
||||
}
|
||||
@@ -438,15 +427,8 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
});
|
||||
|
||||
mp.events.add('updateHealCheckpoint', (xPos, yPos, zPos) => {
|
||||
mp.gui.chat.push("DEBUG: JO LÜPPT");
|
||||
if (activeTask && activeTask.Type == 1) {
|
||||
if (mp.colshapes.exists(activeColshape) && mp.markers.exists(activeMarker)) {
|
||||
activeMarker.setCoords2(xPos, yPos, zPos, 0, 0, 0, false);
|
||||
activeColshape.setCoords2(xPos, yPos, zPos, 0, 0, 0, false);
|
||||
}
|
||||
taskFinish.x = xPos;
|
||||
taskFinish.y = yPos;
|
||||
taskFinish.z = zPos;
|
||||
activeCheckpoint.setCoords2(xPos, yPos, zPos, 0, 0, 0, false);
|
||||
mp.game.ui.setNewWaypoint(xPos, yPos);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
||||
break;
|
||||
|
||||
case 1:
|
||||
var healTask = ReviveTasks.FirstOrDefault(t => t.Victim == victim);
|
||||
var healTask = HealTasks.FirstOrDefault(t => t.Victim == victim);
|
||||
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.");
|
||||
|
||||
Reference in New Issue
Block a user