# Installation

### **How to download the script**

To download the asset, you need to have completed the purchase using your own Keymaster account.&#x20;

Once your purchase is confirmed on our official website, the asset will appear in your Keymaster account. From there, you can download and install it by following the steps outlined in the documentation.

{% hint style="info" %} <mark style="color:blue;">**If the asset was bought through a different account, you can transfer it via the keymaster transfer system**</mark>
{% endhint %}

{% hint style="danger" %} <mark style="color:red;">**NOTE: Please do not edit the name of any of the downloaded folders otherwise the scirpt won't work properly**</mark>
{% endhint %}

### **Dependencies**

{% hint style="warning" %} <mark style="color:orange;">**You must have gamebuild version 2189 or higher and it is required to run on one of the latests server artifacts**</mark>
{% endhint %}

{% hint style="danger" %} <mark style="color:red;">**This asset relies on certain essential dependencies to function correctly. If these dependencies are not installed, the asset may start, but you could encounter errors or warnings in the command console**</mark>
{% endhint %}

| Script                                                                                                                      | Download                                                           |
| --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| **ox\_lib**                                                                                                                 | <https://overextended.dev/ox_lib>                                  |
| **ox\_target OR qb-target**                                                                                                 | <https://overextended.dev/ox_target>                               |
| **screenshot-basic**                                                                                                        | <https://github.com/citizenfx/screenshot-basi>                     |
| <p><strong>Casino DLC IPL Loader</strong><br><em>Needed if you want the poker app, also other Casino DLC can work</em> </p> | <https://forum.cfx.re/t/cayo-perico-casino-dlc-ipl-loader/2099391> |
| **mumble voice** OR **pma voip** OR **tokyio voip** OR **salty chat**                                                       |                                                                    |

### **Correct Asset Placement**

{% hint style="danger" %} <mark style="color:red;">**Properly placing the assets is crucial to avoid errors, FOLLOW THIS ORDER**</mark>
{% endhint %}

To ensure the asset runs smoothly, configure your server.cfg with the sequence specified below:

```lua
# at the bottom of the file and after all the dependecies add

# only if using Casino DLC IPL Loader and want to use poker app
ensure DLCiplLoader

ensure complete_vision_texture
ensure complete_vision_prop
ensure complete_vision

```

### **Database Configuration**

You must update your database in order for the script to work, simply drag and drop the *database.sql* file into your database (make sure to select first the correct database your server is using)

<details>

<summary>SQL</summary>

```sql
CREATE TABLE IF NOT EXISTS `vision` (
	`citizenid` varchar(50) NOT NULL,
	`visorid` varchar(50) NOT NULL UNIQUE,
	`settings` longtext DEFAULT NULL,
	`songs` longtext DEFAULT NULL,
	`calls` longtext DEFAULT NULL,
	PRIMARY KEY (`citizenid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `vision_friends` (
	`id` int NOT NULL AUTO_INCREMENT,
	`citizenid` varchar(50) DEFAULT NULL,
	`name` varchar(50) DEFAULT NULL,
	`visorid` varchar(50) DEFAULT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `vision_gallery` (
	`id` int NOT NULL AUTO_INCREMENT,
	`citizenid` varchar(50) DEFAULT NULL,
	`src` varchar(200) DEFAULT NULL,
	`date` timestamp NULL DEFAULT current_timestamp(),
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `vision_virtual_img` (
	`id` int NOT NULL AUTO_INCREMENT,
	`citizenid` varchar(50) DEFAULT NULL,
	`image` longtext DEFAULT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
```

</details>

### **Item Configuration**

The script uses the Vision Pro item, you need to add it to your server before you can use it. The procedure depends on the scripts and framework your server is using:

<details>

<summary>ESX</summary>

Add this to your database

```sql
INSERT INTO `items` (name, label, weight) VALUES
	('vision_pro', 'Vision Pro', 2)
;
```

</details>

<details>

<summary>QBCORE</summary>

Add this in your items shared file

<pre data-overflow="wrap"><code><strong>['vision_pro'] = {
</strong>    ["name"] = "vision_pro",
    ["label"] = "Vision Pro",
    ["weight"] = 400,
    ["type"] = "item",
    ["image"] = "vision_pro.png",
    ["unique"] = true,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Complete Vision by Complete Scripts"
},
</code></pre>

</details>

### **Handling Photos**

In order to take and store photos you need something where upload them. Here are different options:

With Discord's recent policy changes, many servers might lose access to traditional webhooks. Therefore, we recommend using fivemanage.com. The guide for creating and using the token can be found in the following section.

<details>

<summary>Fivemanage</summary>

1. Create an account at [Fivemanage](https://fivemanage.com/)
2. After you have created an account or logged in, navigate to the [Token](https://www.fivemanage.com/dashboard/token) page and create a new token
3. Copy and paste this Token into the config.lua file at **`Config.Webhook`**

</details>

{% hint style="warning" %} <mark style="color:orange;">**Due to the new terms of Discord it's possible that this method may not work properly**</mark>
{% endhint %}

<details>

<summary>Discord</summary>

1. Right click on a channel dedicated for photos
2. Click Edit Channel
3. Click Integrations
4. Click View Webhooks
5. Click New Webhook
6. Confirm channel
7. Click Copy Webhook URL
8. Paste paste this into the config.lua file at **`Config.Webhook`**

</details>

### Configure the script

As for the last step is access the config files and modify them as you like, please make sure to have a minimum of coding skills before edit those files, a single character wrong won't let the code start.

Main config file can be found in complete\_vision/config.lua

For configuring framework related functions go into complete\_vision/framework, select the folder reguarding your framework (if not ESX or QBCore open the Custom folder), and edit client.lua and server.lua

Another config file can be found in complete\_vision/html/config.js
