> For the complete documentation index, see [llms.txt](https://highqez.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://highqez.gitbook.io/docs/resources/phone-snatcher/installation.md).

# Installation

## Download Resource

{% hint style="success" %}
Purchase the script from our [HighQez Store](https://highqez.tebex.io/). After the purchase, the resource will be available in your [Keymaster Account](https://keymaster.fivem.net/asset-grants)
{% endhint %}

Make sure you purchase the script using the same [Keymaster Account](https://keymaster.fivem.net/) that is linked to your server. If not you will receive a warning "**You lack the required entitlement".**

If you receive the error mentioned above, you may have to transfer the resource from the current Keymaster account to the server's Keymaster account using the transfer feature in Keymaster.

***

## Transfer Resource

{% hint style="success" %}
Unzip the downloaded file and transfer it to your server's resource folder
{% endhint %}

If you are using **FTP**, please ensure you use [**WinSCP** ](https://winscp.net/eng/download.php)to transfer the resource to the server. If you use FileZilla, you may encounter the error "**Failed to verify protected resource**"

***

## Resource Dependency

{% hint style="success" %}
Make sure you have installed and started the below resources on your server
{% endhint %}

<table><thead><tr><th width="207">Name</th><th>Download Link</th></tr></thead><tbody><tr><td>ox_lib</td><td><a href="https://github.com/overextended/ox_lib/releases">https://github.com/overextended/ox_lib/releases</a></td></tr><tr><td>pure-minigames</td><td><a href="https://github.com/purescripts-fivem/pure-minigames/releases">https://github.com/purescripts-fivem/pure-minigames/releases</a></td></tr></tbody></table>

***

## Start Resource

{% hint style="success" %}
Ensure the resource in server.cfg of your server
{% endhint %}

Make sure to start the resource only after all essential server resources have been started. Follow the example below to **ensure highqez\_phonesnatcher**

```
ensure ox_lib #Don't start above this
ensure es_extended/qb-core #Don't start above this

#Start the HighQez resource here

ensure highqez_phonesnatcher

#Start the rest of your resources
```

***

## Resource Items

{% hint style="success" %}
Transfer the item's images from the INSTALL folder of the resource to your server's inventory
{% endhint %}

{% hint style="info" %}
Ensure to add all required **items** to your server
{% endhint %}

<details>

<summary>ESX INVENTORY</summary>

```sql
INSERT INTO `items` (name, label, weight) VALUES
	('flipper_hacking','Flipper Hacking', 1),
	('aphone','aPhone 24', 1),
	('samsamphone','Samsam S55 Ultra', 1)
;
```

</details>

<details>

<summary>OX INVENTORY</summary>

```lua
['flipper_hacking'] = {
    label = 'Flipper Hacking',
    weight = 1,
    close = true,
},
['aphone'] = {
    label = 'aPhone 24',
    weight = 1,
    close = false,
},
['samsamphone'] = {
    label = 'Samsam S55 Ultra',
    weight = 1,
    close = false,
},
```

</details>

<details>

<summary>QS INVENTORY</summary>

```lua
['flipper_hacking']               = {
    ['name'] = 'flipper_hacking',
    ['label'] = 'Flipper Hacking',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'flipper_hacking.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'A hacking device'
},
['aphone']               = {
    ['name'] = 'aphone',
    ['label'] = 'aPhone 24',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'aphone.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Very expensive phone'
},
['samsamphone']               = {
    ['name'] = 'samsamphone',
    ['label'] = 'Samsam S55 Ultra',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'samsamphone.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Very expensive phone'
},
```

</details>

<details>

<summary>OLD QBCore</summary>

```lua
    ["flipper_hacking"] = {
        ["name"] = "flipper_hacking",
        ["label"] = "Flipper Hacking",
        ["weight"] = 100,
        ["type"] = "item",
        ["image"] = "flipper_hacking.png",
        ["unique"] = false,
        ["useable"] = true,
        ["shouldClose"] = true,
        ["combinable"] = nil,
        ["description"] = "A hacking device"
    },
    ['aphone'] = {
        ['name'] = 'aphone', 			  	  		
        ['label'] = 'aPhone 24', 				    
        ['weight'] = 1000, 		
        ['type'] = 'item', 		
        ['image'] = 'aphone.png', 				
        ['unique'] = false, 	
        ['useable'] = false, 	
        ['shouldClose'] = true,	   
        ['combinable'] = nil,   
        ['description'] = 'Very expensive phone'
    },
    ['samsamphone'] = {
        ['name'] = 'samsamphone', 			  	  	
        ['label'] = 'Samsam S55 Ultra', 				
        ['weight'] = 1000, 		
        ['type'] = 'item', 		
        ['image'] = 'samsamphone.png', 		
        ['unique'] = false, 	
        ['useable'] = false, 	
        ['shouldClose'] = true,	   
        ['combinable'] = nil,   
        ['description'] = 'Very expensive phone'
    },
```

</details>

<details>

<summary>NEW QBCore</summary>

```lua
    flipper_hacking = { 
        name = 'flipper_hacking', 
        label = 'Flipper Hacking', 
        weight = 100, 
        type = 'item', 
        image = 'flipper_hacking.png', 
        unique = false, 
        useable = false, 
        shouldClose = false, 
        description = 'A hacking device' 
    },
    aphone = { 
        name = 'aphone', 
        label = 'aPhone 24', 
        weight = 100, 
        type = 'item', 
        image = 'aphone.png', 
        unique = false, 
        useable = false, 
        shouldClose = false, 
        description = 'Very expensive phone' 
    },
    samsamphone = { 
        name = 'samsamphone', 
        label = 'Samsam S55 Ultra', 
        weight = 100, 
        type = 'item', 
        image = 'samsamphone.png', 
        unique = false, 
        useable = false, 
        shouldClose = false, 
        description = 'Very expensive phone' 
    },
```

</details>

***

## Configure Resource

{% hint style="success" %}
Customize the script to suit the specific requirements of your server
{% endhint %}

Open-source files are available for editing the framework function. The main configuration of the resource is provided below.

<details>

<summary>Config File</summary>

```lua
Config = {}

Config.Framework = 'auto' -- 'auto', 'esx' or 'qbcore'

Config.HackingDevice = 'flipper_hacking' -- item name to start the minigame

Config.SuccessRate = 100 -- chance of success 10 to 100

Config.MinTime = 5 -- (Minutes) minimum time to steal the phone

Config.AlertPoliceSuccess = false -- alert the police if the player successfully steals the phone

Config.AlertPoliceFail = false -- alert the police if the player fails to steal the phone

Config.MinDistance = 2.0 -- minimum distance to grab the phone

Config.MaxTry = 3 -- maximum number of tries to steal the phone

Config.PriceHackingDevice = 5000 -- price of the hacking device

Config.Leader = { -- dealer location
    model = 'u_m_m_streetart_01',
    location = vector4(446.0039, -1235.3147, 29.9584, 355.7636),
    blipenabled = true,
    blipname = 'Phone Snatcher Leader',
    blipsprite = 389,
    blipcolour = 59,
    blipscale = 1.0,
    blipshortrange = true,
}

Config.PedSpawn = { -- list of ped spawn locations (random)
    vector3(242.6468, -1115.9561, 29.3236),
    vector3(8.1043, -916.9601, 29.9050),
    vector3(212.7151, -593.0364, 43.8679),
    vector3(462.5270, -693.6348, 27.4210),
    vector3(386.7478, -899.6111, 29.4521),
    vector3(-122.8933, -888.5554, 29.3389),
    vector3(-21.6521, -1001.8614, 29.4998),
    vector3(417.1408, -1108.8044, 30.0487),
    vector3(327.1724, -1011.7714, 29.2908),
    vector3(66.1242, -615.9608, 31.9018),
    vector3(280.1768, -620.6162, 42.0211),
}

Config.Peds = { -- list of peds that can spawn (random)
    "u_f_y_poppymich_02",
    "u_f_m_miranda_02",
    "u_m_m_bankman",
    "u_m_m_aldinapoli",
}

Config.TargetBlip = {
    enabled = true,
    name = 'Phone Target',
    sprite = 1,
    scale = 1.0,
    colour = 46,
    shortRange = true,
}

Config.Rewards = {
    ['aphone'] = { price = 1000 },
    ['samsamphone'] = { price = 1000 },
}

Config.RentBikeSpawn = vector4(446.9450, -1230.0487, 30.1007, 272.5505)

Config.Vehicles = {
    [GetHashKey('bmx')] = { label = 'BMX', rentprice = 100 , deposit = 1000},
}

```

</details>

***
