# Installations

{% hint style="info" %}
If SQL Tables are not created automatically or there is any error, please open a ticket on discord.
{% endhint %}

{% hint style="info" %}
Siri and the Advanced 911 system require AI API setup. For this you need to do extra setup please follow the documentation to install it.
{% endhint %}

## Detailed phone setup and AI setup guide video

{% embed url="<https://youtu.be/zK86dHvlDB4>" %}

## Doing the phone setup

Download the latest version of the script via [Keymaster](https://keymaster.fivem.net/).

Extract the folder in the zipped file you downloaded to your resources folder.

Inside the Resources folder you will see a folder named **stache-phone**. Define this folder in server.cfg

{% hint style="danger" %}
Make sure the name of the script is \``stache-phone`\` do not change it!
{% endhint %}

### Make sure the requirements are up to date!

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FgdWUVRRPCNjCXwU3U4Ld%2Fimage.png?alt=media&#x26;token=99f6d1f0-8b91-4d99-a9f0-38aefe2d7b9e" alt=""><figcaption><p>inside ox_lib/fxmanifest.lua</p></figcaption></figure>

Check the ox\_lib version and check the latest version from [this link](https://github.com/overextended/ox_lib/releases). Make sure you are using the latest version. If you are using a very old version, please update.

Using [oxmysql](https://github.com/overextended/oxmysql) as database driver. To install it, download it from [this](https://github.com/overextended/oxmysql/releases/latest/download/oxmysql.zip) link and drop it into Resources. Start before the phone.

{% hint style="warning" %}
Requirements need to be start before the phone
{% endhint %}

{% tabs %}
{% tab title="server.cfg" %}

```lua
ensure oxmysql -- Requirements
ensure qb-core / es_extended -- Core Defination
ensure ox_lib -- Requirements
ensure inventory -- If you are using an inventory

ensure stache-phone
```

{% endtab %}
{% endtabs %}

### Making adjustments

After performing the above installations, you can take a look at the necessary settings if you need them.

{% content-ref url="configuration" %}
[configuration](https://docs.0resmon.org/0resmon/0resmon-1/stache-resources/stache-phone/configuration)
{% endcontent-ref %}

## Using the AI Service

Azure and Wolfram Keys are needed to use the AI Service. The Azure service normally offers paid services, but **free services** are available. You can choose according to your server capacity. These are the most available methods for Fivem at the moment. If you are a large community, you can optionally install wit, but create a support request for this because a special AI training is required before using wit.

### Getting Wolfram Key

Wolfram is a free service. However, a special definition is required for each server. It is necessary for the AI service to communicate in real time.

Go to the [Wolfram](https://www.wolframalpha.com/). And click this.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2F02lDBP8T3klzJuApmvMF%2Fimage.png?alt=media&#x26;token=770deb9b-e725-41ca-8de5-7e2653890421" alt=""><figcaption><p>Top Right on the page.</p></figcaption></figure>

Create an account and log in. Then go to this [page](https://developer.wolframalpha.com/).

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2F8ei50vjblCg9kTPbHQW1%2Fimage.png?alt=media&#x26;token=43539dce-7c51-4bfd-b057-a7f23b3e511f" alt=""><figcaption></figcaption></figure>

Fill in the blanks as you like and select the type as in the picture.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2Fpob6UWo5PFuL3IjcfNjL%2Fimage.png?alt=media&#x26;token=9ca1acf8-c9fa-4e3b-8a5a-9d174586ec4d" alt=""><figcaption></figcaption></figure>

Then get the api key you created.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2F3IJ9MYb67XRRjTvHDZ6A%2Fimage.png?alt=media&#x26;token=59ba5741-9215-4cbf-a9ba-f2fe3ba38008" alt=""><figcaption><p>Configuration/Variables.lua</p></figcaption></figure>

Place the app id you received here.

### Install the Azure Service

If you are going to use azure as an Api (remember, it is subject to certain fees, but the quality is high.)

Go to the [Azure portal](https://portal.azure.com/). And make this search.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FVZngjEDKWBpgu9MRdpyx%2Fimage.png?alt=media&#x26;token=c26e6bb7-65b2-46f4-af30-4d802e330669" alt=""><figcaption></figcaption></figure>

Create a New One.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FJZkfxuHFPNTc2AGtyEWz%2Fimage.png?alt=media&#x26;token=f0f68c24-5f98-4abe-b37e-3057237c2021" alt=""><figcaption></figcaption></figure>

Make your arrangements and create.

Then go to the Overview section.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FEZwh1N6Bz1JiZxIWvAFk%2Fimage.png?alt=media&#x26;token=ea05032c-935e-48f0-a3ac-b5e8083731a5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FOSPZB5acbaEImvCtEnav%2Fimage.png?alt=media&#x26;token=3210bfb7-4b47-4bf5-be24-5bc7f6d5b482" alt=""><figcaption><p>Configuration/Variables.lua</p></figcaption></figure>

The keys up to this point will go to the places indicated above.

Then go to the azure portal again and do the following search.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FZbWF48jwh9erdzMZl0zJ%2Fimage.png?alt=media&#x26;token=75eceebf-c615-4e0c-b22c-22105b20b458" alt=""><figcaption></figcaption></figure>

Then create a translator in the same way.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2F4WRYGTkOhadvb1CFGwru%2Fimage.png?alt=media&#x26;token=a386f690-6263-490f-a686-cac17dadb6b4" alt=""><figcaption></figcaption></figure>

Go to this section to get our translator keys.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FWdkMdZlJOIt2tplSTzHu%2Fimage.png?alt=media&#x26;token=257cdbcf-5e5a-4cdd-9dbe-8d6ff1e40599" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FVi4bNANxKSBO7PshiXXD%2Fimage.png?alt=media&#x26;token=5ad07434-2302-4c58-9c04-9afe1b34e3c1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FptX54o45uzY83Uy8TSO1%2Fimage.png?alt=media&#x26;token=486aa576-ed12-4b49-bd13-19a8ae5b588d" alt=""><figcaption><p>Configuration/Variables.lua</p></figcaption></figure>

Place the translator keys you received in this section.

{% hint style="info" %}
Proceed to the [Lua Definitions ](#api-key-definitions-on-the-lua-side)Section with these key and region info.
{% endhint %}

### Api Key Definitions on the Lua Side

We are making these edits in `Configuration/Variables.lua`.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FlMixCOl4pvU3gpBE8JAZ%2Fimage.png?alt=media&#x26;token=744e1799-54d0-4fed-a5ad-eb200fd56c4b" alt=""><figcaption><p>Configuration/Variables.lua</p></figcaption></figure>

After making all your Lua-side settings, you need to make changes to `ui/config.js` to use ai services.

{% tabs %}
{% tab title="For Siri" %}
To activate the Siri system, first complete the above installations.

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FFLMJ4bfWsU8WExYMp51j%2Fimage.png?alt=media&#x26;token=6c3fd400-b803-4fa5-ada8-ac6e3c15f1c8" alt=""><figcaption><p>ui/config.js</p></figcaption></figure>
{% endtab %}

{% tab title="For 911" %}

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FLQ9AHOqVSaj0QcCjfv4p%2Fimage.png?alt=media&#x26;token=2bf42351-bc4a-46ec-9daf-52172a8cc693" alt=""><figcaption><p>ui/config.js</p></figcaption></figure>
{% endtab %}
{% endtabs %}
