From 256a096b6043f4b3292729af9fe7722bdfdab623 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 26 Dec 2021 11:48:31 -0600 Subject: [PATCH] Move utils --- scripts/server/moderation.js | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/scripts/server/moderation.js b/scripts/server/moderation.js index 32931e9f..4ee3b3f8 100644 --- a/scripts/server/moderation.js +++ b/scripts/server/moderation.js @@ -1079,5 +1079,43 @@ function forceAccountPasswordResetCommand(command, params, client) { } } +// =========================================================================== + +function isPlayerWeaponBanned(client) { + if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("WeaponBanned"))) { + return true; + } + + return false; +} + +// =========================================================================== + +function isPlayerJobBanned(client) { + if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("JobBanned"))) { + return true; + } + + return false; +} + +// =========================================================================== + +function isPlayerPoliceBanned(client) { + let jobId = getJobFromParams("Police"); + if(doesJobHaveWhiteListEnabled(jobId)) { + if(isPlayerOnJobWhiteList(client, jobId)) { + return true; + } + } + + if(doesJobHaveBlackListEnabled(jobId)) { + if(!isPlayerOnJobBlackList(client, jobId)) { + return true; + } + } + + return false; +} // =========================================================================== \ No newline at end of file