# 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


---

# 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://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-mdt/server-exports.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.
