# Exports

{% hint style="info" %}

#### **Note**

These exports are entirely optional and can be used as needed within your own scripts or integrations.
{% endhint %}

***

## Client

### **Get Player Info**

Returns useful information about a player that can be used to create new dispatch notifications.

{% code title="@parameters" %}

```lua
--- @return table data A table containing the player’s data.
--- @example
--- local data = exports['cd_dispatch']:GetPlayerInfo()
---
--- print(json.encode(data))
```

{% endcode %}

```lua
local data = exports['cd_dispatch3d']:GetPlayerInfo()
```

***

### **Get** All Dispatch Notifications

Returns all active dispatch notifications.

{% code title="@parameters" %}

```lua
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()

--- print(json.encode(notifications))
```

{% endcode %}

```lua
local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
```

***

### Get Player’s Dispatch Data

Returns a player’s dispatch-related character data (e.g., callsign, character name, and status).

<pre class="language-lua" data-title="@parameters"><code class="lang-lua">--- @return table playerData A table containing the player’s dispatch data.
--- @example
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData()
<strong>
</strong>--- print(json.encode(playerData))
</code></pre>

```lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData()
```

***

### Get Config

Returns all configuration data from the dispatch’s config.lua file.

{% code title="@parameters" %}

```lua
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()

--- print(json.encode(config))
```

{% endcode %}

```lua
local config = exports['cd_dispatch']:GetConfig()
```

##

***

## Server

### Get All Dispatch Notifications

Returns all active dispatch notifications.

{% code title="@parameters" %}

```lua
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()

--- print(json.encode(notifications))
```

{% endcode %}

```lua
local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
```

***

### Get Player’s Dispatch Data

Returns a player’s dispatch character data, such as callsign, character name, and status.

{% code title="@parameters" %}

```lua
--- @param source number The player’s server ID.
--- @return table playerData A table containing the player’s dispatch data.
--- @example
--- local source= source
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)

--- print(json.encode(playerData))
```

{% endcode %}

```lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)
```

***

### Get Config

Returns all configuration data from the dispatch’s config.lua file.

{% code title="@parameters" %}

```lua
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()

--- print(json.encode(config))
```

{% endcode %}

```lua
local config = exports['cd_dispatch']:GetConfig()
```
