> 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-mdt/server-exports.md).

# Server Exports

{% hint style="info" %}
Here you will find the list of usable exports for Police MDT, you can use them if you have basic or advanced programming knowledge, we do not recommend using these if you do not have such knowledge.
{% endhint %}

## RegisterWeapon

Use following export to add weapon to registry.

```lua
exports['piotreq_gpt']:RegisterWeapon(data)
```

* data: `table`
  * model: `string` | weapon model name
  * owner: `string` | player identifier / citizenid
  * serial: `string` | random serial numbers

***

## GetDangerCode

Use following export to get current danger code.

```lua
exports['piotreq_gpt']:GetDangerCode(getLabel)
```

* getLabel?: `boolean`
  * Should return label of code?

Return:

* code: `string`

***

## onCodeChange

Use this event handler to follow code change.

```lua
RegisterNetEvent('piotreq_gpt:onCodeChange', function(playerId, data)
    -- do something
end)
```

* playerId: `number`
  * Player id who change danger code
* data: table
  * code: `string` | current code name
  * label: `string` | current code label
  * color: `string` | current code hex color

***

## getLicenses

Get police licenses from config.

```lua
exports['piotreq_gpt']:getLicenses()
```

Return:

* object: `{ [licenseType]: licenseData }`
  * licenseType: `string`
  * licenseData: `table[label: string, access: { [jobName]: jobGrade }]`

***

## CheckPlayerLicense

Use following export to check if player has some police license.

```lua
exports['piotreq_gpt']:CheckPlayerLicense(playerId, licenseName)
```

* playerId: `number`
  * Existing player server id to check
* licenseName: `string`
  * Police license name from config

Return:

* state: `boolean`

***

## GetPlayerLicenses

Use following export to get all player police licenses.

```lua
exports['piotreq_gpt']:GetPlayerLicenses(playerId)
```

* playerId: `number`
  * Existing player server id to check

Return:

* licenses: `licenseData`

### licenseData

* id: `number`
* owner: `string` | player identifier
* type: `string` | license name
* label: `string` | license label
