From 6643f108556f46645663c1fe230637e5a37dbea7 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 30 Mar 2021 21:43:37 -0500 Subject: [PATCH] Add CS job script --- scripts/client/job.js | 76 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 scripts/client/job.js diff --git a/scripts/client/job.js b/scripts/client/job.js new file mode 100644 index 00000000..7301a49c --- /dev/null +++ b/scripts/client/job.js @@ -0,0 +1,76 @@ +// =========================================================================== +// Asshat-Gaming Roleplay +// https://github.com/VortrexFTW/gtac_asshat_rp +// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com) +// =========================================================================== +// FILE: job.js +// DESC: Provides job functions and usage +// TYPE: Client (JavaScript) +// =========================================================================== + +let localPlayerJobType = 0; +let localPlayerWorking = false; +let jobRouteStopBlip = null; +let jobRouteStopSphere = null; + +// =========================================================================== + +function initJobScript() { + logToConsole(LOG_DEBUG, "[Asshat.Job]: Initializing job script ..."); + logToConsole(LOG_DEBUG, "[Asshat.Job]: Job script initialized!"); +} + +// =========================================================================== + +function setLocalPlayerJobType() { + logToConsole(LOG_DEBUG, `[Asshat.Main] Set local player job type to ${tempJobType}`); + localPlayerJobType = tempJobType; +} + +// =========================================================================== + +function setLocalPlayerWorkingState(tempWorking) { + logToConsole(LOG_DEBUG, `[Asshat.Main] Setting working state to ${tempWorking}`); + localPlayerWorking = tempWorking; +} + +// =========================================================================== + +function showJobRouteStop() { + logToConsole(LOG_DEBUG, `[Asshat.Job] Showing route stop`); + if(gta.game == GAME_GTA_SA) { + jobRouteStopSphere = gta.createPickup(1318, position, 1); + } else { + jobRouteStopSphere = gta.createSphere(position, 3); + jobRouteStopSphere.colour = colour; + } + + jobRouteStopBlip = gta.createBlip(position, 0, 2, colour); +} + +// =========================================================================== + +function showJobRouteStop(position, colour) { + logToConsole(LOG_DEBUG, `[Asshat.Job] Showing route stop`); + if(gta.game == GAME_GTA_SA) { + jobRouteStopSphere = gta.createPickup(1318, position, 1); + } else { + jobRouteStopSphere = gta.createSphere(position, 3); + jobRouteStopSphere.colour = colour; + } + + jobRouteStopBlip = gta.createBlip(position, 0, 2, colour); +} + +// =========================================================================== + +function enteredJobRouteSphere() { + logToConsole(LOG_DEBUG, `[Asshat.Job] Entered job route sphere`); + tellServerPlayerArrivedAtJobRouteStop(); + destroyElement(jobRouteStopSphere); + destroyElement(jobRouteStopBlip); + jobRouteStopSphere = null; + jobRouteStopBlip = null; +} + +// =========================================================================== \ No newline at end of file