# Tablet & Mini-CAD

{% hint style="success" %}
Looking for VPS, web, or dedicated hosting? Check out our official [server hosting](https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/fivem-installation/available-plugins/broken-reference)!
{% endhint %}

<figure><img src="https://232668649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4pGN81fb4R6zFhodcu%2Fuploads%2Fzfj66gm8vnxstogenIrY%2Fmini_cad.png?alt=media&#x26;token=03f16d4b-bc92-43c1-84f2-326d8de63f7d" alt=""><figcaption><p>Sonoran CAD - Mini-CAD</p></figcaption></figure>

## Activation Guide

### 1. Download and Install the Core

If you haven't already, be sure to install and configure the [SonoranCAD Core](https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/fivem-installation) first.\
This resource is included in the base framework.

### 2. Start the Resource

In your `server.cfg` file add the following new line:\
`ensure tablet`

### 3. Set URL Convar (Optional)

If you wish to use a custom login page, you can set a convar in your server.cfg.\
\
The easiest way to show your [custom login page](https://docs.sonoransoftware.com/cad/tutorials/customization/custom-login-page) is to use a query string.

`"https://sonorancad.com/?comid=YOUR_COMMUNITY_ID_HERE"`

Simply replace `YOUR_COMMUNITY_ID_HERE` in the URL with your [community ID](https://docs.sonoransoftware.com/cad/tutorials/getting-started/finding-your-community-id-and-authentication-code).\
EX: `https://app.sonorancad.com/?comid=midwestrp`

Add the following to your server.cfg **before** starting the tablet resource:

```
setr sonorantablet_cadUrl "YOUR_URL_HERE"
```

Fill in with your actual URL above with the comid you want.

### 4. Using the Tablet

* Use the `/showcad` command in-game to toggle your tablet. You can also add a custom keybind to open the tablet by going to `GTA Settings` > `Keybinds` > `FiveM`
* Use the `/cadsize <width> <height>` command to resize the tablet to best fit your screen. This size persists on reload of the client.
* Use the `/cadrefresh` command to refresh the tablet if it's not loading properly.

### 5. Using the Mini-CAD

{% hint style="warning" %}
This submodule utilizes API endpoints that require the **Plus** version of Sonoran CAD or higher. For more information, view our [pricing ](https://docs.sonoransoftware.com/cad/pricing/faq)page.
{% endhint %}

* Use the `/minicad` command in-game to display your Mini-CAD. You must be logged into the Police or Fire CAD, and need to have your [API ID](https://docs.sonoransoftware.com/cad/api-integration/getting-started/setting-your-api-id) set.
* While open, use `/showcad` to focus the minicad and allow the elements to be clickable, such as the Attach button.
* You can close or move the Mini-CAD by opening the tablet, and interacting with the Mini-CAD window.
* (Experimental) Use the `/minicadsize <width> <height>` command to resize the Mini-CAD to best fit your screen. This size persists on reload of the client.
* Use the `/minicadrefresh` command to refresh the Mini-CAD if it's not loading properly.
* Controls
  * Use the `Left Arrow Key` to display the previous call.
  * Use the `Right Arrow Key` to display the next call.
  * Use the `K` key to attach or detach to/from the displayed call.
  * Use the `L` key to toggle display of the call details.
  * **All these commands can be edited from the Keybinds menu.**

### 6. Auto API ID

When a user signs into the CAD using the in-game tablet, their[ API ID](https://docs.sonoransoftware.com/cad/api-integration/getting-started/setting-your-api-id) can be automatically be set in the CAD.

To enable this, open the submodule [Check API Id's](https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/fivem-installation/available-plugins/api-id-checker) config and set `forceSetApiId` to `true`.

Additionally, communities using Steam as their framework's `primaryIdentifier` **will need to ensure they have a** [**Steam key set**](https://docs.sonoransoftware.com/cad/integration-plugins/in-game-integration/fivem-installation/..#id-5.-steam-api-key) **for their server**.

## Known Issues

### Tablet SSO Sign In via Discord/Apple

The in-game tablet utilizes an iFrame. Because Apple and Discord have disabled their oauth pages from being viewed inside of an iFrame, users will be unable to use these sign in methods from in-game.

#### 1. Utilize the official Desktop App Overlay system

{% content-ref url="../../../../download/steam-browser-workaround" %}
[steam-browser-workaround](https://docs.sonoransoftware.com/cad/download/steam-browser-workaround)
{% endcontent-ref %}

#### 2. Link your Discord/Apple created account to a Sonoran login email/password.

Because your account was created using Discord/Apple, your email does not yet have a password set to login via Sonoran.

1. Navigate to the [account website](https://account.sonoransoftware.com) -> Recover Password
2. Enter in the email address of the Discord/Apple account
3. Check your email for a link to setting your new password
4. Sign-in on the Tablet using the Sonoran sign-in method (Discord can still be used elsewhere)

If you are having an issue using the Sonoran sign-ing method please see [below](#tablet-showing-grey).

### Timeout SonoranCAD::mini:CallSync

Some users may see `SonoranCAD::mini:CallSync` listed multiple times after recieving a timeout.

When your client recieves a timeout from the server for any reason, it will display a list of the most recent requests. Because Sonoran's Mini-CAD runs frequent sync requests, these will consequenty be displayed.

**This is not an issue with or related to Sonoran CAD**. This is a general timeout between the client and server listing all recent calls as diagnostic information.

![Sonoran CAD Mini - Timeout Debug](https://232668649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4pGN81fb4R6zFhodcu%2Fuploads%2F0a6UWpeIi3cGUVUsoG2o%2FScreen%20Shot%202022-01-06%20at%209.28.58%20PM.png?alt=media\&token=1c6cc5d5-7f9a-4734-9069-fb5cc7f0fca1)

### Tablet Showing Grey

Some users may get a grey, black or blank screen when using the Sonoran Login method before and then opening the tablet and it just being a grey screen.

To resolve this, close FiveM, then to go to your `FiveM Application Data` folder then to `data` and then delete the `nui-storage` folder.

If you still are having issues reach out to our [support team](https://support.sonoransoftware.com).

![Sonoran CAD Tablet - Blank Screen Issue](https://232668649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4pGN81fb4R6zFhodcu%2Fuploads%2Fgit-blob-c558f2d18eb0356a49c71603557b101d9200a956%2FTablet%20Blank%20Error.png?alt=media)
