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

# Client 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 %}

## IsGptOpen

Use following statebag to check if gpt is currently open.

```lua
LocalPlayer.state.GptOpen

Player(playerId).state.GptOpen
```

* playerId: `number`
  * Existing player server id

Return:

* state: `boolean`

***

## OpenGPT

Use following export / event to open gpt.

{% tabs %}
{% tab title="Export" %}

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

{% endtab %}

{% tab title="Event" %}

```lua
TriggerEvent('piotreq_gpt:OpenGPT')
```

{% endtab %}
{% endtabs %}

***

## 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 callback to check if player has police license.

```lua
lib.callback.await('piotreq_gpt:CheckPlayerLicense', false, licenseName)
```

* licenseName: `string`
  * License name from config

Return:

* state: `boolean`

***

## GetPlayerLicenses

Use following callback to get player all police licenses.

```lua
lib.callback.await('piotreq_gpt:GetPlayerLicenses', false)
```

Return:

* licenses: `licenseData`

### licenseData

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