> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/laptop-pack/cameras/exports.md).

# Exports

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

### connectCamera(identifier)

> Use this export to connect to a camera using its identifier
>
> **params:**
>
> * **identifier**:`string` Camera identifier
>
> {% code title="" %}
>
> ```lua
> local identifier = "abcdefg12345"
> exports['av_cameras']:connectCamera(identifier)
> ```
>
> {% endcode %}

### getClosestCameras()

> Retrieves a table of cameras currently rendered around player.
>
> **returns:**
>
> * **owner:**`string` Camera owner, could be server or a player identifier.
> * **settings:**`table` A table with current camera settings
> * **coords:**`table` Camera coords, view coords, rotation, etc.
> * **item:**`string` Item used to place the camera
> * **identifier:**`string` Camera identifier
> * **label:**`string` Camera label
> * **location:**`string` Cam location label
>
> {% code title="" %}
>
> ```lua
> local cameras = exports['av_cameras']:getClosestCameras()
> print(json.encode(cameras, {indent = true}))
> ```
>
> {% endcode %}

### getCamerasFromCoords(coords?,radius?)

> Retrieves a list of cameras close to coords.
>
> **params:**
>
> * **coords?:**`vector3(x,y,z)` World coords or null to use current player coords.
> * **radius?:**`number` Radius or null to use default 50.0
>
> {% code title="" %}
>
> ```lua
> local cameras = exports['av_cameras']:getCamerasFromCoords()
> print(json.encode(cameras, {indent = true}))
> ```
>
> {% endcode %}

<figure><img src="/files/IGEeTm2b9RZwSYnBMxBT" alt=""><figcaption><p>camera data structure</p></figcaption></figure>
{% endtab %}

{% tab title="Server" %}

### groupState(identifier,state)

> Enable/disable an entire group of cameras, blocking the view access for everyone.
>
> params:
>
> * **identifier:**`string` Group identifier
> * **state**:`boolean` Group state
>
> {% code title="" %}
>
> ```lua
> local identifier = "pacific_bank"
> -- Disables group pacific_bank
> exports['av_cameras']:toggleGroup(identifier, false)
> -- Enables group
> exports['av_cameras']:toggleGroup(identifier, true)
> ```
>
> {% endcode %}
> {% endtab %}
> {% endtabs %}
