> For the complete documentation index, see [llms.txt](https://piotreq-scripts.gitbook.io/piotreq-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-job/installation-guide.md).

# Installation Guide

## Policejob Script Installation Guide

This page is dedicated to installation of our banking script. Follow steps listed below to start using pScripts Police Job on your server.

### Additional information

{% hint style="danger" %}
**REMEMBER TO REMOVE ANY SCRIPTS RELATED TO POLICE JOB!**
{% endhint %}

{% hint style="warning" %}
REMOVE handsup.lua FILE from your qb-smallresources IF YOU USE!
{% endhint %}

We don't provide maps used in our preview videos, if you want to buy them, click the links below\
[Prison Map](https://fivem.prompt-mods.com/package/5771366) (Use code "piotreq" for 10% off your purchase)\
[Department Map](https://fmshop.tebex.io/category/government)

### Prerequisities

Before you begin, ensure you have:

1. FiveM server with administrator access
2. Access to your server's database
3. File transfer capability (FTP or direct file access)

{% hint style="danger" %}
Do not use FileZilla - It corrupting files many times when files are transferred.
{% endhint %}

## Step 1: Installing the dependencies

Our script requires 3 dependencies:

1. [ox\_lib](https://github.com/overextended/ox_lib)
2. [oxmysql](https://github.com/overextended/oxmysql/releases)
3. [ox\_target ](https://github.com/overextended/ox_target/releases)/ [qb-target](https://github.com/qbcore-framework/qb-target)
4. [p\_bridge](https://github.com/PiotreeQ/p_bridge)

*Additionaly, we recommend you use* [*MariaDB*](https://mariadb.org/) *as your Database Management System.*

## Step 2: Setting up the Database

For our script to work, you need to modify your database. Run these SQL commands:

<details>

<summary>ESX</summary>

```sql
ALTER TABLE `users`
  ADD IF NOT EXISTS `badge` int(11) DEFAULT NULL,
  ADD IF NOT EXISTS `jail` int(11) NOT NULL DEFAULT 0;

ALTER TABLE `owned_vehicles`
  ADD IF NOT EXISTS `job` varchar(30) DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `police_mugshots` (
  `id` int(11) NOT NULL,
  `suspect` varchar(60) NOT NULL,
  `dob` varchar(30) NOT NULL,
  `officer` varchar(60) NOT NULL,
  `description` varchar(150) NOT NULL,
  `url` longtext NOT NULL
);

CREATE TABLE IF NOT EXISTS `police_outfits` (
  `id` int(11) NOT NULL,
  `job` varchar(30) NOT NULL,
  `grade` longtext NOT NULL,
  `label` varchar(60) NOT NULL,
  `gender` varchar(10) NOT NULL,
  `license` longtext DEFAULT 'none',
  `requirements` varchar(50) NOT NULL,
  `skin` longtext NOT NULL
);

CREATE TABLE IF NOT EXISTS `judgements` (
  `id` int(11) NOT NULL,
  `officer` varchar(46) NOT NULL,
  `player` varchar(46) NOT NULL,
  `offenses` longtext NOT NULL,
  `jail` int(11) NOT NULL,
  `fine` int(11) NOT NULL,
  `time` bigint(25) NOT NULL
);

CREATE TABLE IF NOT EXISTS `police_evidences` (
  `id` varchar(20) NOT NULL,
  `item` longtext NOT NULL,
  `time` bigint(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `police_impound` (
  `officer` varchar(60) NOT NULL,
  `officer_name` varchar(100) NOT NULL,
  `owner` varchar(46) DEFAULT NULL,
  `plate` varchar(10) NOT NULL,
  `vehicle` longtext NOT NULL,
  `location` varchar(60) NOT NULL,
  `reason` varchar(200) NOT NULL,
  `price` int(11) NOT NULL,
  `duration` bigint(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `police_evidences`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_impound`
  ADD PRIMARY KEY IF NOT EXISTS (`plate`);

ALTER TABLE `judgements`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `judgements`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  
ALTER TABLE `police_outfits`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_outfits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `police_mugshots`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_mugshots`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
```

</details>

<details>

<summary>QB</summary>

```sql
ALTER TABLE `players`
  ADD IF NOT EXISTS `badge` int(11) DEFAULT NULL,
  ADD IF NOT EXISTS `jail` int(11) NOT NULL DEFAULT 0;

ALTER TABLE `player_vehicles`
  ADD IF NOT EXISTS `job` varchar(30) DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `police_mugshots` (
  `id` int(11) NOT NULL,
  `suspect` varchar(60) NOT NULL,
  `dob` varchar(30) NOT NULL,
  `officer` varchar(60) NOT NULL,
  `description` varchar(150) NOT NULL,
  `url` longtext NOT NULL
);

CREATE TABLE IF NOT EXISTS `police_outfits` (
  `id` int(11) NOT NULL,
  `job` varchar(30) NOT NULL,
  `grade` longtext NOT NULL,
  `label` varchar(60) NOT NULL,
  `gender` varchar(10) NOT NULL,
  `license` longtext DEFAULT 'none',
  `requirements` varchar(50) NOT NULL,
  `skin` longtext NOT NULL
);

CREATE TABLE IF NOT EXISTS `judgements` (
  `id` int(11) NOT NULL,
  `officer` varchar(46) NOT NULL,
  `player` varchar(46) NOT NULL,
  `offenses` longtext NOT NULL,
  `jail` int(11) NOT NULL,
  `fine` int(11) NOT NULL,
  `time` bigint(25) NOT NULL
);

CREATE TABLE IF NOT EXISTS `police_evidences` (
  `id` varchar(20) NOT NULL,
  `item` longtext NOT NULL,
  `time` bigint(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE  IF NOT EXISTS `police_impound` (
  `officer` varchar(60) NOT NULL,
  `officer_name` varchar(100) NOT NULL,
  `owner` varchar(46) DEFAULT NULL,
  `plate` varchar(10) NOT NULL,
  `vehicle` longtext NOT NULL,
  `location` varchar(60) NOT NULL,
  `reason` varchar(200) NOT NULL,
  `price` int(11) NOT NULL,
  `duration` bigint(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `police_evidences`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_impound`
  ADD PRIMARY KEY IF NOT EXISTS (`plate`);

ALTER TABLE `judgements`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `judgements`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `police_outfits`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_outfits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  
ALTER TABLE `police_mugshots`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_mugshots`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
```

</details>

<details>

<summary>QBOX</summary>

```sql
ALTER TABLE `players`
  ADD IF NOT EXISTS `badge` int(11) DEFAULT NULL,
  ADD IF NOT EXISTS `jail` int(11) NOT NULL DEFAULT 0;

ALTER TABLE `player_vehicles`
  ADD IF NOT EXISTS `job` varchar(30) DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `police_mugshots` (
  `id` int(11) NOT NULL,
  `suspect` varchar(60) NOT NULL,
  `dob` varchar(30) NOT NULL,
  `officer` varchar(60) NOT NULL,
  `description` varchar(150) NOT NULL,
  `url` longtext NOT NULL
);

CREATE TABLE IF NOT EXISTS `police_outfits` (
  `id` int(11) NOT NULL,
  `job` varchar(30) NOT NULL,
  `grade` longtext NOT NULL,
  `label` varchar(60) NOT NULL,
  `gender` varchar(10) NOT NULL,
  `license` longtext DEFAULT 'none',
  `requirements` varchar(50) NOT NULL,
  `skin` longtext NOT NULL
);

CREATE TABLE IF NOT EXISTS `judgements` (
  `id` int(11) NOT NULL,
  `officer` varchar(46) NOT NULL,
  `player` varchar(46) NOT NULL,
  `offenses` longtext NOT NULL,
  `jail` int(11) NOT NULL,
  `fine` int(11) NOT NULL,
  `time` bigint(25) NOT NULL
);

CREATE TABLE IF NOT EXISTS `police_evidences` (
  `id` varchar(20) NOT NULL,
  `item` longtext NOT NULL,
  `time` bigint(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE  IF NOT EXISTS `police_impound` (
  `officer` varchar(60) NOT NULL,
  `officer_name` varchar(100) NOT NULL,
  `owner` varchar(46) DEFAULT NULL,
  `plate` varchar(10) NOT NULL,
  `vehicle` longtext NOT NULL,
  `location` varchar(60) NOT NULL,
  `reason` varchar(200) NOT NULL,
  `price` int(11) NOT NULL,
  `duration` bigint(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `police_evidences`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_impound`
  ADD PRIMARY KEY IF NOT EXISTS (`plate`);

ALTER TABLE `judgements`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `judgements`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `police_outfits`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_outfits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `police_mugshots`
  ADD PRIMARY KEY IF NOT EXISTS (`id`);

ALTER TABLE `police_mugshots`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
```

</details>

You can run these on your preferred Database Management Tool (ex. HeidiSQL, phpMyAdmin etc.)

## Step 3: Downloading the Police Job Script

1. Download the script from your [Keymaster](https://portal.cfx.re/assets/granted-assets).
2. Extract the files to your resources (or any other preffered) folder.
3. Add the following line to your `server.cfg`<br>

   ```
   ensure p_policejob
   ```

## Step 4: Setting up items

### Adding inventory items

Place the items from `p_policejob/INSTALL/ITEMS` in your inventory items file

### Adding item image

Place the images from `p_policejob/INSTALL/ICONS` in your inventory resource's image folder:

* For ox\_inventory: `ox_inventory/web/images/`
* For qb-inventory: `qb-inventory/html/images/`
* For ESX inventory: Check your specific inventory resource's image directory
* For other inventories: Check your specific inventory resource's image directory

## Step 5: Configuration

1. Open `p_policejob/shared` folder
2. Configure our script basing on your needs.

## Step 6: Start using our script

1. Save all changes
2. Restart / Start your FiveM server

Enjoy using your brand new pScripts Police Job Script!

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-job/installation-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
