> For the complete documentation index, see [llms.txt](https://docs.l2s.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.l2s.dev/assets-and-guides/dispatch/integration/exports/client.md).

# Client

## Client Exports

```lua
--- Retrieves the player's current data, including gender, weapon, coordinates, and vehicle details.
--- @return table - A table containing the following keys:
---   - sex (string): The gender of the player.
---   - gun (string): The name of the weapon the player is holding (if any).
---   - ped (integer): The player's ped ID.
---   - coords (table): A vec2 table with the player's rounded x and y coordinates.
---   - name (string): The player's name.
---   - GetVehicleIn (integer): The vehicle ID the player is currently in, or 0 if not in a vehicle.
---   - isInVehicle (boolean): Whether the player is in any vehicle.
---   - source (integer): The player's server ID.

exports['l2s-dispatch']:GetPlayerData()
```

***

```lua
--- Retrieves various data for the specified vehicle.
--- This function fetches the vehicle's name, plate, class, color, and network ID.
--- @param vehicle integer - The vehicle entity ID to retrieve data for.
--- @return table - A table containing the following keys:
---   - name (string): The vehicle's name.
---   - plate (string): The vehicle's plate number.
---   - class (string): The vehicle's class (e.g., Sedan, SUV, etc.).
---   - color (string): The vehicle's color.
---   - id (integer): The vehicle's network ID.

exports['l2s-dispatch']:GetVehicleData(vehicle)
```

***

<pre class="language-lua"><code class="lang-lua"><strong>--- Finds the nearest security camera to the given coordinates within a specified range.
</strong>--- @param x number - The x-coordinate of the position to check.
--- @param y number - The y-coordinate of the position to check.
--- @param range number - The maximum range to search for a nearby camera.
--- @return string|boolean - The key of the nearest camera if found, or false if no camera is within range.

exports['l2s-dispatch']:GetNearestCamera(x, y, range)
</code></pre>

***

```lua
--- Toggles the visibility of the large UI dashboard.
--- Closes the dashboard if it is currently open, and opens it if it is closed.
--- @return None

exports['l2s-dispatch']:ToggleDashboard()
```

***

<pre class="language-lua"><code class="lang-lua">---- Toggles the visibility of the Small UI Unit list.
--- Closes the dashboard if it is currently open, and opens it if it is closed.
--- @return None
<strong>
</strong><strong>exports['l2s-dispatch']:ToggleList()
</strong></code></pre>

***

```lua
--- Displays a list of units or Small UI.
--- @param toggle boolean - If true, forces the list to show; if false, hides the list.
--- @return None

exports['l2s-dispatch']:ShowList(toggle)
```

***

<pre class="language-lua"><code class="lang-lua">--- Checks if the player has access based on their job.
--- Returns the hub or department name if the player has access, otherwise returns false.
--- @param job string - The job of the player to check access for.
--- @return string|boolean - Returns the hub or department name if the player has access, or false if they don't.
<strong>
</strong><strong>exports['l2s-dispatch']:CheckAccess(job)
</strong></code></pre>

***

```lua
--- Toggles the dispatch mode based on the provided boolean value.
--- If true, enables dispatch mode; if false, disables it.
--- @param bool boolean - The state of the dispatch mode: true to enable, false to disable.
--- @return None

exports['l2s-dispatch']:ToggleDispatchMode(bool)
```

***

```lua
--- Forces the player to quit the body cam view.
--- @return None

exports['l2s-dispatch']:ForceQuitBodyCam()
```

```lua
--- Forces Close CCTV Camera.
--- @return None

exports['l2s-dispatch']:CloseCCTVCamera()
```
