From 801f118a02f296108440d37c210e379de45fe5a1 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:30:27 -0600 Subject: [PATCH] Re-add old police commands (unfinished) --- scripts/server/job/police.js | 156 +++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/scripts/server/job/police.js b/scripts/server/job/police.js index b842a8a2..a3aeeed9 100644 --- a/scripts/server/job/police.js +++ b/scripts/server/job/police.js @@ -6,3 +6,159 @@ // DESC: Provides police officer job functions and usage // TYPE: Job (JavaScript) // =========================================================================== + +function policeTazerCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeCuffCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeArrestCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeSearchCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeDragCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeDetainCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== \ No newline at end of file