Fix Medic 7
This commit is contained in:
@@ -26,7 +26,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
var sortText;
|
||||
var deadRespawned = false;
|
||||
var timeLeft = null;
|
||||
var deathTime;
|
||||
|
||||
var ticketName: string;
|
||||
var pointsName: string;
|
||||
@@ -324,7 +323,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
dimension: 0
|
||||
});
|
||||
reviveTaskMenuMedic.Close();
|
||||
deathTime = tasks[index].TimeLeft;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.InMenu = false;
|
||||
ambulanceImagePos = 0.325
|
||||
@@ -332,7 +330,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
taskFinish = tasks[index].Position;
|
||||
taskRange = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z, true);
|
||||
activeTask = tasks[index];
|
||||
mp.events.callRemote("getTaskTimeLeft", tasks[index].Victim);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -503,6 +500,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
});
|
||||
|
||||
mp.events.add('render', () => {
|
||||
|
||||
if (activeTask) {
|
||||
rangeLeft = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, taskFinish.x, taskFinish.y, taskFinish.z, true).toFixed(2);
|
||||
if (rangeLeft > 1.9) {
|
||||
@@ -526,33 +524,35 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
|
||||
var currentDate = new Date();
|
||||
|
||||
if (deadRespawned == false) {
|
||||
//timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 60));
|
||||
if (timeLeft < 60) mp.events.call("cutMedicEarnings");
|
||||
} else {
|
||||
//timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 120));
|
||||
if (timeLeft < 1) mp.events.call("destroyMedicTaskCheckpoint");
|
||||
}
|
||||
if (timeLeft != null) {
|
||||
if (deadRespawned == false) {
|
||||
//timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 60));
|
||||
if (timeLeft < 60) mp.events.call("cutMedicEarnings");
|
||||
} else {
|
||||
//timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 120));
|
||||
if (timeLeft < 1) mp.events.call("destroyMedicTaskCheckpoint");
|
||||
}
|
||||
|
||||
if (deadRespawned == false) {
|
||||
mp.game.graphics.drawText(timeLeft + "s ", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [60, 179, 113, 255],
|
||||
scale: [0.3, 0.3],
|
||||
outline: true,
|
||||
centre: true
|
||||
});
|
||||
} else {
|
||||
{
|
||||
if (deadRespawned == false) {
|
||||
mp.game.graphics.drawText(timeLeft + "s", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [255, 203, 145, 255],
|
||||
scale: [0.3, 0.3],
|
||||
color: [60, 179, 113, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true,
|
||||
centre: true
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
{
|
||||
mp.game.graphics.drawText(timeLeft + "s", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [255, 203, 145, 255],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true,
|
||||
centre: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user