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

# Installation

## # STEP 1 - Check dependencies

Make sure you have installed all  [dependencies](https://docs.l2s.dev/assets-and-guides/police-hub)[ ](https://app.gitbook.com/o/LxAnKQVihSTFbs0mIi9R/s/8M3S3jS0Ei85e8gHrdRq/~/changes/37/assets-and-guides/police-hub).

## # STEP 2 - Drag And Drop

Drag and drop the  <mark style="color:blue;">l2s-policehub</mark> to your resources folder.

## # STEP 3 - Setup Items and Images

Set Up Items According to your inventory

{% tabs %}
{% tab title="qb-inventory" %}
1- Add Items in qb-core/shared/items.lua

```lua
["bodycam"] = {
	["name"] = "bodycam",
	["label"] = "Bodycam",
	["weight"] = 500, 
	["type"] = "item", 
	["image"] = "bodycam.png", 	
	["unique"] = true, 
	["useable"] = false, 
	["shouldClose"] = true,	 
	["combinable"] = nil, 
	["description"] = "Body Camera for police"
},

```

\
2- Add Image in qb-inventory/html/images/...<br>

{% file src="/files/KIIsXItXks069nwKHPb9" %}
{% endtab %}
{% endtabs %}

## # STEP 4 - Set Up metadata

Go to qb-core/server/player.lua and add this metadata

{% tabs %}
{% tab title="qb-core (Old Method)" %}
If you have the old method of metadata  (your metadata in player.lua instead of config.lua) put it inside this path:

<mark style="color:red;">qb-core/server/player.lua</mark>

```lua
PlayerData.metadata['policehub'] = PlayerData.metadata['policehub'] or {
        ['alerts'] = {
            ['enablealerts'] = true,
            ['autoclear'] = false,
            ['mute'] = false,
        },
        ['wings'] = {
            [1] = false,
            [2] = false,
            [3] = false,
            [4] = false,
            [5] = false,
            [6] = false,
            [7] = false,
            [8] = false,
            [9] = false,
        },
        ['direction'] = nil,
        ['Assignment'] = nil,
        ['OfficerPlayTime'] = 0,
    }
    PlayerData.metadata["dutybusy"] = PlayerData.metadata["dutybusy"] ~= nil and PlayerData.metadata["dutybusy"] or false
    PlayerData.metadata["dutybreak"] = PlayerData.metadata["dutybreak"] ~= nil and PlayerData.metadata["dutybreak"] or false
```

\ <br>

<figure><img src="https://content.gitbook.com/content/5Ouu0TE6RGB2wJP79c1y/blobs/6lOTh0IfeJvzIg0yaTgS/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="qb-core (New Method-)" %}
If you have the last version of qb-core and (your metadata in config.lua) copy paste the code in this path:

<mark style="color:red;">qb-core/config.lua</mark>

```lua
        policehub = {
            ['alerts'] = {
                ['enablealerts'] = true,
                ['autoclear'] = false,
                ['mute'] = false,
            },
            ['wings'] = {
                [1] = false,
                [2] = false,
                [3] = false,
                [4] = false,
                [5] = false,
                [6] = false,
                [7] = false,
                [8] = false,
                [9] = false,
            },
            ['direction'] = nil,
            ['Assignment'] = nil,
            ['OfficerPlayTime'] = 0,
        },
        
```

<figure><img src="https://content.gitbook.com/content/5Ouu0TE6RGB2wJP79c1y/blobs/iB4NrID67y8wEeF4va66/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="QBox" %}

If you use QBox Framework copy paste the code in this path:

<mark style="color:red;">qbx-core/server/player.lua</mark>

```lua
    playerData.metadata['policehub'] = playerData.metadata['policehub'] or {
        ['alerts'] = {
            ['enablealerts'] = true,
            ['autoclear'] = false,
            ['mute'] = false,
        },
        ['wings'] = {
            [1] = false,
            [2] = false,
            [3] = false,
            [4] = false,
            [5] = false,
            [6] = false,
            [7] = false,
            [8] = false,
            [9] = false,
        },
        ['direction'] = nil,
        ['Assignment'] = nil,
        ['OfficerPlayTime'] = 0,
    }
    playerData.metadata["dutybusy"] = playerData.metadata["dutybusy"] ~= nil and playerData.metadata["dutybusy"] or false
    playerData.metadata["dutybreak"] = playerData.metadata["dutybreak"] ~= nil and playerData.metadata["dutybreak"] or false
```

<figure><img src="https://content.gitbook.com/content/5Ouu0TE6RGB2wJP79c1y/blobs/dXehKzvK84mjwfEtDQK5/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## # STEP 5- Dependencies for inventory

{% hint style="danger" %}
To use bodycam system you must add some function in your inventory script
{% endhint %}

&#x20;1-Add This In <mark style="color:red;">AddItem</mark> Function : in qb-inventory or your inventory script

```lua
if item == 'bodycam' then
	TriggerClientEvent('l2s-policehub:client:togglebody', source)
end
```

<figure><img src="https://content.gitbook.com/content/5Ouu0TE6RGB2wJP79c1y/blobs/xtaPbe8Z2a3ufrqfjKwl/image.png" alt="" width="563"><figcaption></figcaption></figure>

2- Add This In <mark style="color:red;">RemoveItem</mark> Function : in qb-inventory or your inventory script

```lua
if item == 'bodycam' then
	TriggerClientEvent('l2s-policeuhub:client:cancelbody', -1, Player.PlayerData.source)
end
```

<figure><img src="https://content.gitbook.com/content/5Ouu0TE6RGB2wJP79c1y/blobs/c4KeczJ2ktlQxweWCNzN/image.png" alt="" width="563"><figcaption></figcaption></figure>

## # STEP 6 - Start The Script

1 - Start the script on your  <mark style="color:blue;">server.cfg</mark>

```cfscript
ensure l2s-policehub
```
