# Installation

First we want you to know that our script only supports the following versions of the two most used frameworks, in older versions it may be usable but we do not provide support since the development focuses on the following versions:

{% tabs %}
{% tab title="QBCore" %}
{% code title="server.cfg" overflow="wrap" %}

```
ensure oxmysql/icmysql
ensure qb-core
...(make sure to start the inventory before the script)

ensure pma-voice
ensure origen_police
```

{% endcode %}

#### Now you have to insert the SQL files into your database:

* [origen\_police/\[assets\]/qb-core.sql](https://docs.origennetwork.store/origen-police/sql#qbcore)

### Put that items on shared of qb-core.

If you have ox\_inventory you can ignore this part because you'll add the items in the items.lua file of the inventory later.

{% code title="qb-core/shared/items.lua" %}

```lua
['instant_camera'] = {['name'] = 'instant_camera', ['label'] = 'Instant camera', ['weight'] = 0, ['type'] = 'item', ['image'] = 'polaroid.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A simple camera designed to take photos at a crime scene'}, 
['photo'] = {['name'] = 'photo', ['label'] = 'Photo', ['weight'] = 0, ['type'] = 'item', ['image'] = 'photos.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'An image'},
['evidence_a'] = {["name"] = "evidence_a", ["label"] = "Evidence of bullet", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_a.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_az'] = {["name"] = "evidence_az", ["label"] = "Evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_az.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_b'] = {["name"] = "evidence_b", ["label"] = "Vehicle evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_b.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_n'] = {["name"] = "evidence_n", ["label"] = "Impact evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_n.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_ne'] = {["name"] = "evidence_ne", ["label"] = "Footprint evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_ne.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_r'] = {["name"] = "evidence_r", ["label"] = "Blood evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_r.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_ro'] = {["name"] = "evidence_ro", ["label"] = "Evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_ro.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['evidence_v'] = {["name"] = "evidence_v", ["label"] = "Drug evidence", ["weight"] = 0, ["type"] = "item", ["image"] = "evidence_v.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Evidence obtained from a crime scene"}, 
['report_evidence'] = {["name"] = "report_evidence", ["label"] = "Evidence report", ["weight"] = 0, ["type"] = "item", ["image"] = "report_evidence.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Here there can be collected up to 4 pieces of evidence"}, 
['k9'] = {["name"] = "k9", ["label"] = "K9 whistle", ["weight"] = 0, ["type"] = "item", ["image"] = "whistle.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Use the whistle to call the K9 unit"}, 
['lspd_badge'] = {["name"] = "lspd_badge", ["label"] = "Police badge", ["weight"] = 0, ["type"] = "item", ["image"] = "lspd_badge.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Your identification as a police officer, includes your rank and badge number"}, 
['bcsd_badge'] = {["name"] = "bcsd_badge", ["label"] = "Sheriff badge", ["weight"] = 0, ["type"] = "item", ["image"] = "bcsd_badge.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Your identification as a sheriff's agent, including your rank and badge number"}, 
['police_cad'] = {["name"] = "police_cad", ["label"] = "Police tablet", ["weight"] = 0, ["type"] = "item", ["image"] = "tablet.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "Your personal tablet with all the information of the San Andreas police"}, 
['megaphone'] = {["name"] = "megaphone", ["label"] = "Megaphone", ["weight"] = 0, ["type"] = "item", ["image"] = "megaphone.png", ["unique"] = true, ["useable"] = true, ["shouldClose"] = false, ["combinable"] = nil, ["description"] = "A megaphone to make your voice heard"},
```

{% endcode %}
{% endtab %}

{% tab title="ESX" %}
{% code title="server.cfg" overflow="wrap" %}

```
ensure oxmysql/icmysql
ensure es_extended
...(make sure to start the inventory before the script)

ensure pma-voice
ensure origen_police
```

{% endcode %}

#### Now you have to insert the SQL files into your database:

* [origen\_police/\[assets\]/esx.sql](https://docs.origennetwork.store/origen-police/sql#esx)
  {% endtab %}
  {% endtabs %}

Place images from the <mark style="color:red;">**origen\_police/\[assets]/inventory\_images**</mark> path into your inventory images directory.

{% hint style="warning" %}
We recommend uploading our script files without using FileZilla, as the upload process may corrupt our scripts. As a recommendation, please use WinSCP or other reliable programs to upload the files.
{% endhint %}

## Inventory modifications

If your inventory script don't appear here you don't have to modify anything inside it.

{% tabs %}
{% tab title="qb-inventory" %}
At the end of the file <mark style="color:yellow;">`qb-inventory/server/main.lua`</mark>

```lua
exports('GetStashItems', GetStashItems)

RegisterServerEvent('qb-inventory:server:SaveStashItems', function(stashId, items)
    MySQL.insert('INSERT INTO stashitems (stash, items) VALUES (@stash, @items) ON DUPLICATE KEY UPDATE items = @items', {
        ['@stash'] = stashId,
        ['@items'] = json.encode(items)
    })
    if Stashes[stashId] then
	Stashes[stashId].items = items
    end
end)
```

{% endtab %}

{% tab title="ox\_inventory" %}
This is only for servers using ox\_inventory and QBCore, servers using ESX can ignore this.

Insert this in <mark style="color:yellow;">`ox_inventory/data/items.lua`</mark>&#x20;

```lua
['instant_camera'] = {
	label = "Instant Camera",
	weight = 200,
	server = {
		export = "origen_police.instant_camera"
	},
	consume = 0
},
['photo'] = {
	label = "Photo",
	weight = 200,
	server = {
		export = "origen_police.photo"
	},
	consume = 0
},
['report_evidence'] = {
	label = "Report Evidence",
	weight = 200,
	server = {
		export = "origen_police.report_evidence"
	},
	consume = 0
},
['k9'] = {
	label = "K9 Whistle",
	weight = 200,
	server = {
		export = "origen_police.k9"
	},
	consume = 0
},
['lspd_badge'] = {
	label = "LSPD Badge",
	weight = 200,
	server = {
		export = "origen_police.lspd_badge"
	},
	consume = 0
},
['bcsd_badge'] = {
	label = "BCSD Badge",
	weight = 200,
	server = {
		export = "origen_police.bcsd_badge"
	},
	consume = 0
},
['fib_badge'] = {
	label = "FIB Badge",
	weight = 200,
	server = {
		export = "origen_police.fib_badge"
	},
	consume = 0
},
['police_cad'] = { -- By default the item name is police_cad, but you can change in origen_police/config/commands.lua -> Config.Commands.OpenPoliceCad.item
	label = "Police tablet",
	weight = 200,
	server = {
		export = "origen_police.police_cad"
	},
	consume = 0
},
['evidence_a'] = {
	label = "Bullet evidence",
	weight = 200,
	consume = 0
},
['evidence_az'] = {
	label = "Evidence",
	weight = 200,
	consume = 0
},
['evidence_b'] = {
	label = "Vehicle evidence",
	weight = 200,
	consume = 0
},
['evidence_n'] = {
	label = "Impact evidence",
	weight = 200,
	consume = 0
},
['evidence_ne'] = {
	label = "Footprint evidence",
	weight = 200,
	consume = 0
},
['evidence_r'] = {
	label = "Blood evidence",
	weight = 200,
	consume = 0
},
['evidence_ro'] = {
	label = "Evidence",
	weight = 200,
	consume = 0
},
['evidence_v'] = {
	label = "Drug evidence",
	weight = 200,
	consume = 0
},
```

{% endtab %}

{% tab title="core\_inventory" %}
At the end of the file <mark style="color:yellow;">`core_inventory/client/main.lua`</mark>

```lua
exports("GetCurrentWeaponData", function()
    return currentWeaponData
end)
```

{% endtab %}
{% endtabs %}

## Clothing modifications

If your clothing script don't appear here you don't have to modify anything inside it.

{% tabs %}
{% tab title="qb-clothing" %}
At the end of the file <mark style="color:yellow;">`qb-clothing/client/main.lua`</mark>

```lua
exports("GetSkinData", function()
    return skinData
end)
```

{% endtab %}
{% endtabs %}

## Ambulance modifications

If your ambulance script don't appear here you don't have to modify anything inside it.

{% tabs %}
{% tab title="esx\_ambulancejob" %}
At the end of the file <mark style="color:yellow;">`esx_ambulancejob/client/job.lua`</mark>

```lua
RegisterCommand('revivep', function()
    local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
    revivePlayer(closestPlayer)
end)

RegisterCommand('healp', function()
    local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
    ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
        if quantity > 0 then
            local closestPlayerPed = GetPlayerPed(closestPlayer)
            local health = GetEntityHealth(closestPlayerPed)
            if health > 0 then
                local playerPed = PlayerPedId()
                isBusy = true
                ESX.ShowNotification(_U('heal_inprogress'))
                TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
                Wait(10000)
                ClearPedTasks(playerPed)
                TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit')
                TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'big')
                ESX.ShowNotification(_U('heal_complete', GetPlayerName(closestPlayer)))
                isBusy = false
            else
                ESX.ShowNotification(_U('player_not_conscious'))
            end
        else
            ESX.ShowNotification(_U('not_enough_medikit'))
        end
    end, 'medikit')
end)
```

{% endtab %}
{% endtabs %}

## Setup CFG Permissions

{% tabs %}
{% tab title="QBCore" %}
Check that you have all these lines in your cfg, if you don't have any add them.

```
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_ace resource.qb-core command allow
add_ace qbcore.god command allow
add_principal qbcore.god group.admin
add_principal qbcore.god qbcore.admin
add_principal qbcore.admin qbcore.mod
```

Now you will need to register your license as the qbcore.god group. To do this, you can use this example **replacing your license**.

```python
add_principal identifier.license:8f1a3xxxxxxxxxxxxxxxx qbcore.god # Player Name
```

To check if you have correctly configured the permissions you should have the empty Config.Maps which is in config/markers.lua and the SETTINGS button should appear at the bottom right of the tablet.

Example of how the Config.Maps should be:

{% code title="config/markers.lua" overflow="wrap" %}

```lua
Config.Maps = { -- YOU CAN USE THIS OPTION OR THE IN GAME MENU INSIDE THE POLICE TABLET
    -- PLACE YOUR STATION NAME HERE, Example: "default-gta"
}
```

{% endcode %}

If you have the config/markers.lua correctly, you should get this message on F8 when starting the script for the first time:

{% hint style="warning" %}
WARNING: NO ACTIVE MAPS, PLEASE ADD SOME IN THE SETTING TAB OF THE POLICE TABLE
{% endhint %}

Screenshot of the location of the settings tab, if it's not showed check this guide again or ask in our discord server.

<figure><img src="https://3936778620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPLI7NdIesJTaEUHH6a2U%2Fuploads%2FVLJqo5eO4L4cQ0GOEhtq%2Fimage.png?alt=media&#x26;token=2ad60120-a680-4824-8a00-e1c2fe0bf33a" alt="" width="375"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="ESX" %}
You will need to check that the permission group your character has is one of those listed in config/permissions.lua. Example of the default ones:

```lua
Config.PermissionsGroups = {
    "mod", "admin", "superadmin", "god" -- list of groups that will have all permissions, like "mod", "admin", "superadmin", etc
}
```

To check if you have a valid permission group you should have the empty Config.Maps which is in config/markers.lua and the SETTINGS button should appear at the bottom right of the tablet.

Example of how the Config.Maps should be:

{% code title="config/markers.lua" %}

```lua
Config.Maps = { -- YOU CAN USE THIS OPTION OR THE IN GAME MENU INSIDE THE POLICE TABLET
    -- PLACE YOUR STATION NAME HERE, Example: "default-gta"
}
```

{% endcode %}

If you have the config/markers.lua correctly, you should get this message on F8 when starting the script for the first time:

{% hint style="warning" %}
WARNING: NO ACTIVE MAPS, PLEASE ADD SOME IN THE SETTING TAB OF THE POLICE TABLE
{% endhint %}

Screenshot of the location of the settings tab, if it's not showed check this guide again or ask in our discord server.

<figure><img src="https://3936778620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPLI7NdIesJTaEUHH6a2U%2Fuploads%2F62gH7Skc3vDsBe9l0nGI%2Fimage.png?alt=media&#x26;token=c02766c8-c5fb-4387-a4e7-e3dc439474c9" alt="" width="375"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Important

Remember to follow the pma-voice installation steps here:

{% content-ref url="installation/pma-voice" %}
[pma-voice](https://docs.origennetwork.store/origen-police/installation/pma-voice)
{% endcontent-ref %}


---

# 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.origennetwork.store/origen-police/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.
