From f9dae69561877fb621e36b9619099182e3581b41 Mon Sep 17 00:00:00 2001 From: VortrexFTW Date: Mon, 7 Sep 2020 11:35:21 -0500 Subject: [PATCH] Add keybind processing --- scripts/server/utilities.js | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index 2cd9f754..a792c2f9 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -3382,4 +3382,65 @@ function sendAllBlips(client) { sendAllJobBlips(client); } +// --------------------------------------------------------------------------- + +function processHoldActionKey(client) { + let closestJobId = getClosestJobPointId(client.player.position); + let closestVehicle = getClosestVehicle(client.player.position); + let closestHouse = getClosestHouse(client.player.position); + let closestBusiness = getClosestBusiness(client.player.position); + let jobData = getJobData(closestJobId); + + + if(getClientCurrentSubAccount(client).job == AG_JOB_NONE) { + if(jobData.position.distance(client.player.position) <= serverConfig.takeJobDistance) { + takeJob(client, closestJobId); + messageClientSuccess(client, "You now have the " + String(jobData.name) + " job"); + } + } else { + if(jobData.jobType == getClientCurrentSubAccount(client).job) { + if(jobData.position.distance(client.player.position) <= serverConfig.startWorkDistance) { + startWorking(client); + messageClientSuccess(client, "You are now working as a " + String(jobData.name)); + showStartedWorkingTip(client); + return true; + } + } else { + messageClientError(client, "This is not your job!"); + messageClientInfo(client, `Use /quitjob to quit your current job.`); + } + } +} + +// --------------------------------------------------------------------------- + +function processPressActionKey(client) { + // Check job stuff + let closestJob = getClosestJob(client.player.position); + + if(getClientCurrentSubAccount(client).job == AG_JOB_NONE) { + if(closestJob.position.distance(client.player.position) <= serverConfig.takeJobDistance) { + + } + } +} + +// --------------------------------------------------------------------------- + +function processHoldVehicleLightsKey(client) { + +} + +// --------------------------------------------------------------------------- + +function processHoldVehicleLockKey(client) { + +} + +// --------------------------------------------------------------------------- + +function processHoldVehicleEngineKey(client) { + +} + // --------------------------------------------------------------------------- \ No newline at end of file