From a64adccfb96efdf4dc25c8cd889efeac66f38280 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 16:08:49 +0200 Subject: [PATCH] Fix Medic 4 --- .../Interaction/factioninteraction.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ReallifeGamemode.Client/Interaction/factioninteraction.ts b/ReallifeGamemode.Client/Interaction/factioninteraction.ts index 43edb4d4..8ec8fade 100644 --- a/ReallifeGamemode.Client/Interaction/factioninteraction.ts +++ b/ReallifeGamemode.Client/Interaction/factioninteraction.ts @@ -25,7 +25,7 @@ export default function factionInteraction(globalData: IGlobalData) { var rangeLeft; var sortText; var deadRespawned = false; - var timeLeft = 0; + var timeLeft = null; var deathTime; var ticketName: string; @@ -475,7 +475,7 @@ export default function factionInteraction(globalData: IGlobalData) { activeCheckpoint.destroy(); activeCheckpoint = null; activeTask = null; - timeLeft = 0; + timeLeft = null; mp.events.callRemote("MedicTaskTimeout"); }); @@ -486,18 +486,19 @@ export default function factionInteraction(globalData: IGlobalData) { mp.events.callRemote("PayCutMedicEarnings"); activeTask = null; deadRespawned = false; - timeLeft = 0; + timeLeft = null; } else if (activeTask.Type == 1){ activeCheckpoint.destroy(); activeCheckpoint = null; mp.events.callRemote("delHealTaskAsMedic", activeTask.Victim); activeTask = null; + timeLeft = null; } }); mp.events.add('setTaskTimeLeft', (taskTimeLeft) => { if (activeTask) { - activeTask.TimeLeft = taskTimeLeft; + timeLeft = taskTimeLeft; } }); @@ -527,14 +528,14 @@ export default function factionInteraction(globalData: IGlobalData) { if (deadRespawned == false) { //timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 60)); - if (activeTask.TimeLeft < 60) mp.events.call("cutMedicEarnings"); + if (timeLeft < 60) mp.events.call("cutMedicEarnings"); } else { - timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 120)); - if (activeTask.TimeLeft < 1) mp.events.call("destroyMedicTaskCheckpoint"); + //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(activeTask.TimeLeft.toString() + "s ", [0.5, 0.88], { + mp.game.graphics.drawText(timeLeft.toString() + "s ", [0.5, 0.88], { font: 7, color: [60, 179, 113, 255], scale: [0.3, 0.3],