From 98769435bee651e8c9cd75ce774a33da4b97920d Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 1 Aug 2022 11:35:00 -0500 Subject: [PATCH] Woops wrong arg + check if no job for blip update --- scripts/server/job.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/server/job.js b/scripts/server/job.js index 221821e5..3a5981cd 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -1658,7 +1658,7 @@ function setJobBlipCommand(command, params, client) { if (toLowerCase(blipParam) == "none") { blipId = -1; } else { - if (isNull(getGameConfig().blipSprites[getGame()][typeParam])) { + if (isNull(getGameConfig().blipSprites[getGame()][blipParam])) { let blipTypes = Object.keys(getGameConfig().blipSprites[getGame()]); let chunkedList = splitArrayIntoChunks(blipTypes, 10); @@ -3170,7 +3170,7 @@ function createJobLocationBlip(jobId, locationId) { } if (areServerElementsSupported()) { - let blip = createGameBlip(tempJobData.locations[locationId].position, blipModelId, 1, getColourByName("yellow")); + let blip = createGameBlip(tempJobData.locations[locationId].position, blipModelId, 2, getColourByName("yellow")); if (blip != false) { tempJobData.locations[locationId].blip = blip; @@ -3186,7 +3186,7 @@ function createJobLocationBlip(jobId, locationId) { let clients = getClients(); for (let i in clients) { - updateJobBlipsForPlayer(client); + updateJobBlipsForPlayer(clients[i]); } } } else { @@ -3938,7 +3938,7 @@ function updateJobBlipsForPlayer(client) { for (let i in getServerData().jobs) { for (let j in getServerData().jobs[i].locations) { - if (getPlayerJob(client) == 0 || getPlayerJob(client) == i) { + if (getPlayerJob(client) == -1 || getPlayerJob(client) == i) { showElementForPlayer(getServerData().jobs[i].locations[j].blip, client); } else { hideElementForPlayer(getServerData().jobs[i].locations[j].blip, client); @@ -3973,6 +3973,18 @@ function getLowestJobRank(jobIndex) { // =========================================================================== +function getHighestJobRank(jobIndex) { + let highestRank = 0; + for (let i in getServerData().jobs[jobIndex].ranks) { + if (getJobRankData(jobIndex, i).level > getJobRankData(jobIndex, highestRank).level) { + highestRank = i; + } + } + return highestRank; +} + +// =========================================================================== + function createJobRouteLocationMarker(jobIndex, jobRouteIndex, jobRouteLocationIndex) { let marker = null; if (isGameFeatureSupported("sphere")) {