Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -13,8 +13,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
var screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
var player = mp.players.local;
|
||||
var tasks;
|
||||
var deathSeconds;
|
||||
var initTasks;
|
||||
var newTasks;
|
||||
var sorting = 0;
|
||||
var firstSorting = true;
|
||||
@@ -27,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;
|
||||
@@ -40,6 +38,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
/*mp.events.add("updateFactionBlips", (type, taskList) => {
|
||||
|
||||
});
|
||||
|
||||
});*/
|
||||
mp.events.add("showFactionInteractionLSPD", (userFactionId, isDuty, userFactionName, isFactionLeader) => {
|
||||
//LSPD
|
||||
@@ -280,13 +279,9 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
});
|
||||
|
||||
|
||||
mp.events.add("showMedicTasks", (type, taskList, deathTimes) => {
|
||||
mp.events.add("showMedicTasks", (type, taskList) => {
|
||||
|
||||
tasks = JSON.parse(taskList);
|
||||
deathSeconds = JSON.parse(deathTimes);
|
||||
if (sorting === 0) {
|
||||
initTasks = tasks;
|
||||
}
|
||||
|
||||
//mp.events.call("sortFactionTasks", false);
|
||||
|
||||
@@ -407,6 +402,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
mp.events.add("sortFactionTasks", (sortByKey) => {
|
||||
if (firstSorting) {
|
||||
sortText = "Nach Uhrzeit";
|
||||
@@ -462,7 +458,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
function getDistance1(index) {
|
||||
return mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, newTasks[index].Position.x, newTasks[index].Position.y, newTasks[index].Position.z, true).toFixed(2);
|
||||
@@ -479,7 +475,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
activeCheckpoint.destroy();
|
||||
activeCheckpoint = null;
|
||||
activeTask = null;
|
||||
timeLeft = 0;
|
||||
timeLeft = null;
|
||||
mp.events.callRemote("MedicTaskTimeout");
|
||||
});
|
||||
|
||||
@@ -490,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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -530,15 +527,15 @@ 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 < 1) mp.events.call("cutMedicEarnings");
|
||||
//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));
|
||||
//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 + "s ", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [60, 179, 113, 255],
|
||||
scale: [0.3, 0.3],
|
||||
@@ -547,7 +544,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
});
|
||||
} else {
|
||||
{
|
||||
mp.game.graphics.drawText(activeTask.TimeLeft.toString() + "s", [0.5, 0.88], {
|
||||
mp.game.graphics.drawText(timeLeft + "s", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [255, 203, 145, 255],
|
||||
scale: [0.3, 0.3],
|
||||
|
||||
Reference in New Issue
Block a user