# Installation

### DEPENDENCIES

> **REQUIRED DEPENDENCIES**

<table data-full-width="false"><thead><tr><th>Resource</th><th>Download</th></tr></thead><tbody><tr><td>Apex Library</td><td><a href="https://astudios.tebex.io/package/5541419">Apex Studios Tebex Store</a></td></tr><tr><td>Framework</td><td><a href="https://github.com/qbcore-framework/qb-core">QBCore</a></td></tr><tr><td>Target</td><td><a href="https://github.com/qbcore-framework/qb-target">qb-target</a> / <a href="https://github.com/overextended/ox_target">ox_target</a></td></tr><tr><td>Menu</td><td><a href="https://github.com/qbcore-framework/qb-menu">qb-menu</a> &#x26; <a href="https://github.com/qbcore-framework/qb-input">qb-input</a> / <a href="https://github.com/overextended/ox_lib">ox_lib</a></td></tr><tr><td>Inventory</td><td><ul><li><a href="https://github.com/qbcore-framework/qb-inventory">qb-inventory</a></li><li><a href="https://github.com/loljoshie/lj-inventory">lj-inventory</a></li><li><a href="https://github.com/Project-Sloth/ps-inventory">ps-inventory</a></li><li><a href="https://github.com/overextended/ox_inventory">ox_inventory</a></li><li><a href="https://buy.quasar-store.com/category/2395209">Quasar Inventory</a></li></ul></td></tr><tr><td>Dispatch</td><td><ul><li><a href="https://github.com/qbcore-framework/qb-core">QBCore</a></li><li><a href="https://github.com/Project-Sloth/ps-dispatch">ps-dispatch</a></li><li><a href="https://codesign.pro/package/4206357">cd_dispatch</a></li><li><a href="https://buy.quasar-store.com/package/5799904">qs-dispatch</a></li></ul></td></tr><tr><td>MDT</td><td><ul><li><a href="https://github.com/qbcore-framework/qb-core">QBCore</a></li><li><a href="https://github.com/Project-Sloth/ps-mdt">ps-mdt</a></li><li><a href="https://store.aljunier-development.com/package/4774628">al_mdt</a></li><li><a href="https://buy.quasar-store.com/package/5799904">qs-dispatch</a></li></ul></td></tr></tbody></table>

> **OPTIONAL DEPENDENCIES (IF NOT ADDED, YOU'LL HAVE TO SET THEM TO FALSE IN CONFIG)**

| Resource    | Download                                                                                                          |
| ----------- | ----------------------------------------------------------------------------------------------------------------- |
| Radial Menu | [qb-radialmenu](https://github.com/qbcore-framework/qb-radialmenu)                                                |
| Minigame    | [ps-ui](https://github.com/Project-Sloth/ps-ui) or [qb-skillbar](https://github.com/qbcore-framework/qb-skillbar) |
| Mapping     | [Gabz](https://fivem.gabzv.com/package/4724502) Recommend / Whatever you want                                     |

### RESOURCE INSTALLATION GUIDE

> **1) RESOURCE DOWNLOAD**

{% hint style="info" %}
Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
{% endhint %}

> **2) RESOURCE POSITIONING**

{% hint style="info" %}
**You need  to make sure that apex\_lib is always started before any of our scripts!**

```lua
ensure apex_lib
ensure [apex] -- or ensure apex_lawenforcement
```

{% endhint %}

> **3) ASSET ADDING**

{% hint style="info" %}

1. Open apex\_lawenforcement > assets > inventory\_images
2. Copy files from the folder and add them into your inventory image folder
3. Open apex\_lawenforcement > assets > sounds
4. Copy files from the folder and add into your interaction sounds
   {% endhint %}

> **4) ITEM ADDING**

{% hint style="info" %}

```lua
['gunrack']     = {['name'] = 'gunrack',    ['label'] = 'Gunrack',      ['weight'] = 100, ['type'] = 'item', ['image'] = 'gunrack.png',     ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Very useful if you are a Law Enforcement Officer and want to rack your weapons in your vehicle.'},
['boltcutter']  = {['name'] = 'boltcutter', ['label'] = 'Bolt Cutter',  ['weight'] = 100, ['type'] = 'item', ['image'] = 'boltcutter.png',  ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Bolt cutter used to cut small pieces of metal.'},
```

{% endhint %}

> **5) JOB ADDING**

{% hint style="info" %}

```lua
['police'] = {
    label = 'Law Enforcement',
    type = "leo",
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'Cadet',
            payment = 50
        },
        ['1'] = {
            name = 'Police Offier I',
            payment = 60
        },
        ['2'] = {
            name = 'Police Offier II',
            payment = 70
        },
        ['3'] = {
            name = 'Police Offier III',
            payment = 80
        },
        ['4'] = {
            name = 'Sergeant I',
            isboss = true,
            payment = 95
        },
        ['5'] = {
            name = 'Sergeant II',
            isboss = true,
            payment = 110
        },
        ['6'] = {
            name = 'Lieutenant',
            isboss = true,
            payment = 140
        },
        ['7'] = {
            name = 'Captain',
            isboss = true,
            payment = 155
        },
    },
},
```

{% endhint %}

> **6) HANDCUFF EXPORT**

{% hint style="info" %}
**There is a short line of code, that you'll have to adjust, follow the list of steps below:**

1. Find the file: qb-smallresources > client > handsup.lua
2. Find the line:&#x20;

   ```lua
   if exports['qb-policejob']:IsHandcuffed() then return end
   ```
3. And delete it or make it like below:

   ```lua
   -- if exports['qb-policejob']:isHandcuffed() then return end
   ```
4. If you have this export in other scripts, repeat the process.
   {% endhint %}

> **7) OX\_INVENTORY**

{% hint style="info" %}
**If you are using ox\_inventory and want to use the breakout minigame. You'll need to do the following:**

* Find the file: ox\_inventory > modules > bridge > qb > client.lua
* Find this code:

  ```lua
  RegisterNetEvent('police:client:GetCuffed', function()
  	PlayerData.cuffed = not PlayerData.cuffed
  	LocalPlayer.state:set('invBusy', PlayerData.cuffed, false)

  	if not PlayerData.cuffed then return end

  	Weapon.Disarm()
  end)
  ```
* Remove or comment the code.

*If this isn't removed or commented. They player will not be able to access their inventory, if they break out of cuffs.*
{% endhint %}

> **8) RADIAL MENU**

{% hint style="info" %}
**In your Radial Menu script, you'll have to remove a section of code to prevent having 2 menus for the policejob.**

* Find the file: qb-radialmenu > config.lua
* Go to line 569 (This is unedited config file):&#x20;
* Find this code:

  ```lua
  ["police"] = {
      {
          id = 'emergencybutton',
          title = 'Emergency button',
          icon = 'bell',
          type = 'client',
          event = 'police:client:SendPoliceEmergencyAlert',
          shouldClose = true
      }, {
          id = 'checkvehstatus',
          title = 'Check Tune Status',
          icon = 'circle-info',
          type = 'client',
          event = 'qb-tunerchip:client:TuneStatus',
          shouldClose = true
      }, {
          id = 'resethouse',
          title = 'Reset house lock',
          icon = 'key',
          type = 'client',
          event = 'qb-houses:client:ResetHouse',
          shouldClose = true
      }, {
          id = 'takedriverlicense',
          title = 'Revoke Drivers License',
          icon = 'id-card',
          type = 'client',
          event = 'police:client:SeizeDriverLicense',
          shouldClose = true
      }, {
          id = 'policeinteraction',
          title = 'Police Actions',
          icon = 'list-check',
          items = {
              {
                  id = 'statuscheck',
                  title = 'Check Health Status',
                  icon = 'heart-pulse',
                  type = 'client',
                  event = 'hospital:client:CheckStatus',
                  shouldClose = true
              }, {
                  id = 'checkstatus',
                  title = 'Check status',
                  icon = 'question',
                  type = 'client',
                  event = 'police:client:CheckStatus',
                  shouldClose = true
              }, {
                  id = 'escort',
                  title = 'Escort',
                  icon = 'user-group',
                  type = 'client',
                  event = 'police:client:EscortPlayer',
                  shouldClose = true
              }, {
                  id = 'searchplayer',
                  title = 'Search',
                  icon = 'magnifying-glass',
                  type = 'client',
                  event = 'police:client:SearchPlayer',
                  shouldClose = true
              }, {
                  id = 'jailplayer',
                  title = 'Jail',
                  icon = 'user-lock',
                  type = 'client',
                  event = 'police:client:JailPlayer',
                  shouldClose = true
              }
          }
      }, {
          id = 'policeobjects',
          title = 'Objects',
          icon = 'road',
          items = {
              {
                  id = 'spawnpion',
                  title = 'Cone',
                  icon = 'triangle-exclamation',
                  type = 'client',
                  event = 'police:client:spawnCone',
                  shouldClose = false
              }, {
                  id = 'spawnhek',
                  title = 'Gate',
                  icon = 'torii-gate',
                  type = 'client',
                  event = 'police:client:spawnBarrier',
                  shouldClose = false
              }, {
                  id = 'spawnschotten',
                  title = 'Speed Limit Sign',
                  icon = 'sign-hanging',
                  type = 'client',
                  event = 'police:client:spawnRoadSign',
                  shouldClose = false
              }, {
                  id = 'spawntent',
                  title = 'Tent',
                  icon = 'campground',
                  type = 'client',
                  event = 'police:client:spawnTent',
                  shouldClose = false
              }, {
                  id = 'spawnverlichting',
                  title = 'Lighting',
                  icon = 'lightbulb',
                  type = 'client',
                  event = 'police:client:spawnLight',
                  shouldClose = false
              }, {
                  id = 'spikestrip',
                  title = 'Spike Strips',
                  icon = 'caret-up',
                  type = 'client',
                  event = 'police:client:SpawnSpikeStrip',
                  shouldClose = false
              }, {
                  id = 'deleteobject',
                  title = 'Remove object',
                  icon = 'trash',
                  type = 'client',
                  event = 'police:client:deleteObject',
                  shouldClose = false
              }
          }
      }
  },
  ```
* Remove or comment the code.
  {% endhint %}

> **9) QB-PRISON**

{% hint style="info" %}
**To be able to use qb-prison with our Law Enforcement Script, you'll have to adjust some code, please do as follow:**

* Find the file: qb-prison > client > main.lua
* Find the line:&#x20;

  ```lua
  if invokingResource and invokingResource ~= 'qb-policejob' and invokingResource ~= 'qb-ambulancejob' and invokingResource ~= GetCurrentResourceName() then
  ```
* And replace that with:

  ```lua
  if invokingResource and invokingResource ~= 'apex_lawenforcement' and invokingResource ~= 'qb-ambulancejob' and invokingResource ~= GetCurrentResourceName() then
  ```

**In other words, replace: `qb-policejob` with `apex_lawenforcement`**
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apx-studios.com/docs/resources/government-jobs/apex-law-enforcement/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
