# Exports and Events

## CreateDocument

With following event you are able to create document for player.

{% tabs %}
{% tab title="Client Side" %}

* documentType `string`
* photo `string`

```lua
TriggerServerEvent('p_documents:CreateDocument', {
   type = documentType,
   photo = photo
})
```

{% endtab %}
{% endtabs %}

### Example of Usage

<pre class="language-lua"><code class="lang-lua">local documentType = 'idcard' -- idcard / driver / weapon / doj / mechanic
<strong>local photo = exports["MugShotBase64"]:GetMugShotBase64(PlayerPedId(), false)
</strong><strong>TriggerServerEvent('p_documents:CreateDocument', {
</strong>   type = type,
   photo = photo
})
</code></pre>

***

## ShowBusinessCard

With this event you can show business card for nearest players.

{% tabs %}
{% tab title="Client Side" %}

```lua
TriggerServerEvent('p_documents:showBusinessCard')
```

{% endtab %}
{% endtabs %}

***

## ShowBadge

With this event you can show badge for nearest players.

{% tabs %}
{% tab title="Client Side" %}

```lua
TriggerServerEvent('p_documents:showBadge')
```

{% endtab %}
{% endtabs %}


---

# 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/documents/exports-and-events.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.
