okokDocs
  • About Us
  • Scripts
    • okokVehicleControl
      • Config file
    • okokMechanicJob
      • Config file
    • okokPoliceJob
      • Config file
      • qb-inventory support
    • okokBossMenu
      • Config file
    • okokMulticharacter
      • Config file
    • okokPhone
    • okokSpawnSelector
      • Config file
      • qb-multicharacter support
    • okokLoadingScreen
      • Config file
    • okokVehicleSales
      • Config file
    • okokShop
      • Config file
    • okokGasStation
      • Config file
    • okokTuning
      • Config file
    • okokGarage
      • Config file
      • RGB vehicle colors
      • Inventories metadata
      • Housing integrations
      • qb-phone support
    • okokVehicleShop
      • Config file
      • Common errors
    • okokBanking
      • Config file
      • Paycheck transactions
      • Registering transactions
    • okokMarketplace
      • Config file
      • Common errors
    • okokChat
      • Config file
      • Export
    • okokBilling
      • Config file
      • Snippets
    • okokCrafting
      • Config file
    • okokContract
      • Config file
    • okokTalkToNPC
      • Config file
    • okokReports
      • Config file
    • okokNotify
      • Config file
      • Snippets
    • okokTextUI
      • Config file
      • Snippets
    • okokRequests
    • okokDeleteVehicles
      • Config file
  • Others
    • Discord Webhook
Powered by GitBook
On this page
  • Installation Guide
  • Requirements:
  • Execute the following SQL code in your database:
  • QBCORE ONLY
  • Server artifacts
  1. Scripts

okokPoliceJob

PreviousConfig fileNextConfig file

Last updated 10 months ago

Installation Guide

Requirements:

ox_lib v3.16.2+ ().

Execute the following SQL code in your database:

CREATE TABLE IF NOT EXISTS `okokpolicejob_reports` (
    `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `reporter` VARCHAR(255) NOT NULL,
    `phone` VARCHAR(255) NOT NULL,
    `date` VARCHAR(255) NOT NULL,
    `description` TEXT NOT NULL,
    `status` INT NOT NULL DEFAULT '0'
);

ALTER TABLE `users` 
DROP COLUMN IF EXISTS `ankleMonitor`,
ADD COLUMN `ankleMonitor` BOOLEAN NOT NULL DEFAULT '0',
DROP COLUMN IF EXISTS `isHandcuffed`,
ADD COLUMN `isHandcuffed` BOOLEAN NOT NULL DEFAULT '0',
DROP COLUMN IF EXISTS `jailTime`,
ADD COLUMN `jailTime` INT NOT NULL DEFAULT '0',
DROP COLUMN IF EXISTS `communityService`,
ADD COLUMN `communityService` INT NOT NULL DEFAULT '0';

INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('handcuffs', 'Handcuffs', 1, 1, 1);
CREATE TABLE IF NOT EXISTS `okokpolicejob_reports` (
    `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `reporter` VARCHAR(255) NOT NULL,
    `phone` VARCHAR(255) NOT NULL,
    `date` VARCHAR(255) NOT NULL,
    `description` TEXT NOT NULL,
    `status` INT NOT NULL DEFAULT '0'
);

ALTER TABLE `players` 
DROP COLUMN IF EXISTS `ankleMonitor`,
ADD COLUMN `ankleMonitor` BOOLEAN NOT NULL DEFAULT '0',
DROP COLUMN IF EXISTS `isHandcuffed`,
ADD COLUMN `isHandcuffed` BOOLEAN NOT NULL DEFAULT '0',
DROP COLUMN IF EXISTS `jailTime`,
ADD COLUMN `jailTime` INT NOT NULL DEFAULT '0',
DROP COLUMN IF EXISTS `communityService`,
ADD COLUMN `communityService` INT NOT NULL DEFAULT '0';

QBCORE ONLY

Add Item:

handcuffs = { name = 'handcuffs', label = 'Handcuffs', weight = 100, type = 'item', image = 'handcuffs.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = 'Handcuffs' },

If using qb-clothing, add the following code on client/main.lua, after exports('getOutfits',getOutfits):

local function getJobOutfits(gradeLevel, requiredJob)
    local data = Config.Outfits[requiredJob]
    local gender = "male"
    if QBCore.Functions.GetPlayerData().charinfo.gender == 1 then gender = "female" end
    QBCore.Functions.TriggerCallback('qb-clothing:server:getOutfits', function(result)
        openMenu({
            {menu = "roomOutfits", label = Lang:t("outfits.roomOutfits"), selected = true, outfits = data[gender][gradeLevel]},
            {menu = "myOutfits", label = Lang:t("outfits.myOutfits"), selected = false, outfits = result},
            {menu = "character", label = Lang:t("outfits.character"), selected = false},
            {menu = "accessoires", label = Lang:t("outfits.accessoires"), selected = false}
        })
    end)
end
exports('getJobOutfits', getJobOutfits)

Server artifacts

Make sure your server artifacts version is up to date.

Windows:

Linux:

YouTube Video
https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip
https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/