# Installation

### Dependencies

<table data-header-hidden><thead><tr><th width="311">Dependency</th><th width="173.37557351977276">Install</th></tr></thead><tbody><tr><td><strong>Resource</strong></td><td><strong>Install</strong></td></tr><tr><td><a href="https://github.com/overextended/oxmysql"><code>oxmysql</code></a></td><td>Required</td></tr><tr><td><a href="https://github.com/citizenfx/screenshot-basic"><code>screenshot-basic</code></a></td><td>Required</td></tr></tbody></table>

## Asset download

1. Download your resource from FiveM's Keymaster.
2. Unzip zip folder and place it into your resource folder.&#x20;
3. Add ensure l2s-policehub to your server start config. Make sure to place anywhere below the framework and dependencies resources.

## Items installation

```
["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"},
```

## Metadata installation

```
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
```

## Dependencies for inventory

Add Item: Add This In AddItem Function : in qb-inventory or qb-core like

<figure><img src="https://94117183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA33F93eBCxt7JnedmZm5%2Fuploads%2FonNHLrVKg02NxohPfjZY%2F%E2%80%8F%D9%84%D9%82%D8%B7%D8%A9%20%D8%A7%D9%84%D8%B4%D8%A7%D8%B4%D8%A9%202023-07-11%20%D9%81%D9%8A%203.59.11%C2%A0%D9%85.png?alt=media&#x26;token=5db803e1-922c-43a3-acb6-8376bc955b15" alt="" width="375"><figcaption></figcaption></figure>

<pre><code><strong>if item == 'bodycam' then
</strong>	TriggerClientEvent('l2s-policehub:client:togglebody', source)
end
</code></pre>

Remove Item: Add This In RemoveItem Function : in qb-inventory or qb-core like

<figure><img src="https://94117183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA33F93eBCxt7JnedmZm5%2Fuploads%2FyexHO0FqE8yWee8tMaxH%2F%E2%80%8F%D9%84%D9%82%D8%B7%D8%A9%20%D8%A7%D9%84%D8%B4%D8%A7%D8%B4%D8%A9%202023-07-11%20%D9%81%D9%8A%204.01.35%C2%A0%D9%85.png?alt=media&#x26;token=6afc6743-8d65-42fa-aa71-cf5701178f25" alt="" width="375"><figcaption></figcaption></figure>

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

## Finally Customize Your setting in Config.lua

And don't forget setup webhocks in config
