# Installation

## Dependencies

<details>

<summary>ES EXTENDED</summary>

You will need the latest version of [es\_extended](https://github.com/ESX-Official/es_extended).

* Extract the contents of the archive to your resources folder.
* Start the resource near the top of your resources in your server.cfg.

</details>

<details>

<summary>INTERACT-SOUND</summary>

You will need the latest version of [interact-sound](https://github.com/plunkettscott/interact-sound).

* Extract the contents of the archive to your resources folder.
* Start the resource near the top of your resources in your server.cfg.

</details>

***

## Inventory setup

<details>

<summary> QB-INVENTORY or PS-INVENTORY</summary>

* 1 - Paste the code below in qb-core/shared/items.lua

```lua
   zatpc                            = { name = 'zatpc',                  label = 'Gaming Setup',                        weight = 1,         type = 'item',      image = 'zatpc.png',                           unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Gaming Setup' },
   zatminingrack                    = { name = 'zatminingrack',          label = 'Mining Rack',                         weight = 1,         type = 'item',      image = 'zatminingrack.png',                   unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Metal Rack with 10 GPU slots' },   
   zatgpu                           = { name = 'zatgpu',                 label = 'GPU',                                 weight = 1,         type = 'item',      image = 'zatgpu.png',                          unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'GPU' },
   zatcpu                           = { name = 'zatcpu',                 label = 'CPU',                                 weight = 1,         type = 'item',      image = 'zatcpu.png',                          unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'CPU' },
   zatps                            = { name = 'zatps',                  label = 'Power Supply',                        weight = 1,         type = 'item',      image = 'zatps.png',                           unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Power Supply' },
   zatmb                            = { name = 'zatmb',                  label = 'Mother Board',                        weight = 1,         type = 'item',      image = 'zatmb.png',                           unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Mother Board' },
   zatmodem                         = { name = 'zatmodem',               label = 'Modem',                               weight = 1,         type = 'item',      image = 'zatmodem.png',                        unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Modem' },
   zatbaskets                       = { name = 'zatbaskets',             label = 'Small Wicker Basket',                 weight = 1,         type = 'item',      image = 'zatbaskets.png',                      unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Wicker Basket used for storage.' },
   zatbasketm                       = { name = 'zatbasketm',             label = 'Wicker Basket',                       weight = 1,         type = 'item',      image = 'zatbasketm.png',                      unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Wicker Basket used for storage.' },
   zatminingfan                     = { name = 'zatminingfan',           label = 'GPU Rack Cooler',                         weight = 100,       type = 'item',      image = 'zatminingfan.png',                    unique = true, useable = true,     shouldClose = true,    combinable = nil,   description = 'Fan - 60 and 120 RPM...' },

```

* 2 -  Paste the code below in qb/ps-inventory/html/js/app.js<br>

  ```javascript
  case "zatgpu":
      return `<p>Type: ${itemData.info.type}</p>
              <p>Performance:${itemData.info.performance}%</p>
              <p>Freq:${itemData.info.hz}Ghz</p>`;  
   case "zatcpu":
       return `<p>Type: ${itemData.info.type}</p>
               <p>Performance:${itemData.info.performance}%</p>`;  
   case "zatmb":
        return `<p>Type: ${itemData.info.type}</p>
                <p>Performance:${itemData.info.performance}%</p>`;  
  case "zatps":
        return `<p>Type: ${itemData.info.type}</p>
                <p>Performance:${itemData.info.performance}%</p>`;  
  ```
* 3 - Copy the images from \[images] and paste them into qb/ps-inventory/html/images.<br>

</details>

<details>

<summary>OX-INVENTORY</summary>

* 1 - Paste the code below under ox\_inventory/data/items.lua

```lua
	["zatpc"] = {
		label = "Gaming Setup",
		weight = 1,
		stack = false,
		close = true,
		description = "Gaming Setup",
		client = {
			image = "zatpc.png",
		}
	},
	["zatminingrack"] = {
		label = "Mining Rack",
		weight = 1,
		stack = false,
		close = true,
		description = "Metal Rack with 10 GPU slots",
		client = {
			image = "zatminingrack.png",
		}
	},
	["zatgpu"] = {
		label = "GPU",
		weight = 1,
		stack = false,
		close = true,
		description = "GPU",
		client = {
			image = "zatgpu.png",
		}
	},
	["zatcpu"] = {
		label = "CPU",
		weight = 1,
		stack = false,
		close = true,
		description = "CPU",
		client = {
			image = "zatcpu.png",
		}
	},
	["zatps"] = {
		label = "Power Supply",
		weight = 1,
		stack = false,
		close = true,
		description = "Power Supply",
		client = {
			image = "zatps.png",
		}
	},
	["zatmb"] = {
		label = "Mother Board",
		weight = 1,
		stack = false,
		close = true,
		description = "Mother Board",
		client = {
			image = "zatmb.png",
		}
	},
	["zatmodem"] = {
		label = "Modem",
		weight = 1,
		stack = false,
		close = true,
		description = "Modem",
		client = {
			image = "zatmodem.png",
		}
	},
	["zatbaskets"] = {
		label = "Small Wicker Basket",
		weight = 1,
		stack = false,
		close = true,
		description = "Wicker Basket used for storage.",
		client = {
			image = "zatbaskets.png",
		}
	},
	["zatbasketm"] = {
		label = "Wicker Basket",
		weight = 1,
		stack = false,
		close = true,
		description = "Wicker Basket used for storage.",
		client = {
			image = "zatbasketm.png",
		}
	},
	["zatminingfan"] = {
		label = "Rack Cooler",
		weight = 100,
		stack = false,
		close = true,
		description = "Fan - 60 and 120 RPM...",
		client = {
			image = "zatresfan.png",
		}
	},
```

* 2 - Paste the code below into ox\_inventory/modules/items/client.lua

```lua
local MiningProps = {
	["zatpc"]           = {model = 'prop_gaming_table'},
    ["zatminingrack"]   = {model = 'prop_mining_rack'},
    ["zatminingfan"]    = {model = 'prop_mining_fan'},
    ["zatbaskets"]      = {model = 'prop_basket_s'},
    ["zatbasketm"]      = {model = 'prop_basket_m'},
}

Item('zatpc', function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			itemInfo= {}
			TriggerEvent("zat-desktop:client:UseItem", "zatpc", MiningProps["zatpc"].model, itemInfo)
			TriggerServerEvent("zat-desktop:server:RemoveItemOx", slot, nil)
		end
	end)
end)

Item('zatminingrack', function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			itemInfo= {}
			TriggerEvent("zat-desktop:client:UseItem", "zatminingrack", MiningProps["zatminingrack"].model, itemInfo)
			TriggerServerEvent("zat-desktop:server:RemoveItemOx", slot, nil)
		end
	end)
end)

Item('zatminingfan', function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			itemInfo= {}
			TriggerEvent("zat-desktop:client:UseItem", "zatminingfan", MiningProps["zatminingfan"].model, itemInfo)
			TriggerServerEvent("zat-desktop:server:RemoveItemOx", slot, nil)
		end
	end)
end)

Item('zatbaskets', function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			itemInfo= {}
			TriggerEvent("zat-desktop:client:UseItem", "zatbaskets", MiningProps["zatbaskets"].model, itemInfo)
			TriggerServerEvent("zat-desktop:server:RemoveItemOx", slot, nil)
		end
	end)
end)

Item('zatbasketm', function(data, slot)
	ox_inventory:useItem(data, function(data)
		if data then
			itemInfo= {}
			TriggerEvent("zat-desktop:client:UseItem", "zatbasketm", MiningProps["zatbasketm"].model, itemInfo)
			TriggerServerEvent("zat-desktop:server:RemoveItemOx", slot, nil)
		end
	end)
end)

```

* 3- Copy the images from \[images] and paste them into ox\_inventory/web/images.

</details>

<details>

<summary>QS-INVENTORY</summary>

* 1- Add the code below into qs-inventory/shared/items.lua:

```lua
['zatpc']                  = {
        ['name'] = 'zatpc',
        ['label'] = 'Gaming Setup',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatpc.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatminingrack']                  = {
        ['name'] = 'zatminingrack',
        ['label'] = 'Mining Rack',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatminingrack.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatgpu']                  = {
        ['name'] = 'zatgpu',
        ['label'] = 'GPU',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatgpu.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatcpu']                  = {
        ['name'] = 'zatcpu',
        ['label'] = 'CPU',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatcpu.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatps']                  = {
        ['name'] = 'zatps',
        ['label'] = 'Power Supply',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatps.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatmb']                  = {
        ['name'] = 'zatmb',
        ['label'] = 'Mother Board',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatmb.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatmodem']                  = {
        ['name'] = 'zatmodem',
        ['label'] = 'Silent Fan',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatmodem.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatbaskets']                  = {
        ['name'] = 'zatbaskets',
        ['label'] = 'Small Wicker Basket',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatbaskets.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatbasketm']                  = {
        ['name'] = 'zatbasketm',
        ['label'] = 'Wicker Basket',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatbasketm.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
    ['zatminingfan']                  = {
        ['name'] = 'zatminingfan',
        ['label'] = 'GPU Rack Cooler',
        ['weight'] = 0,
        ['type'] = 'item',
        ['image'] = 'zatminingfan.png',
        ['unique'] = true,
        ['useable'] = true,
        ['shouldClose'] = false,
        ['combinable'] = nil,
        ['description'] = '...'
    },
```

* 2 - Paste the code below into qs-inventory/server/custom/misc/CreateUseableItem.lua

```lua
local MiningProps = {
	["zatpc"]           = {model = 'prop_gaming_table'},
    ["zatminingrack"]   = {model = 'prop_mining_rack'},
    ["zatminingfan"]    = {model = 'prop_mining_fan'},
    ["zatbaskets"]      = {model = 'prop_basket_s'},
    ["zatbasketm"]      = {model = 'prop_basket_m'},
}

CreateUsableItem('zatpc', function(source, item)
    local src = source
    itemInfo= {}
    TriggerClientEvent("zat-desktop:client:UseItem", src, "zatpc", MiningProps["zatpc"].model, itemInfo)
    exports['qs-inventory']:RemoveItem(src, "zatpc", 1)
end)

CreateUsableItem('zatminingrack', function(source, item)
    local src = source
    itemInfo= {}
    TriggerClientEvent("zat-desktop:client:UseItem", src, "zatminingrack", MiningProps["zatminingrack"].model, itemInfo)
    exports['qs-inventory']:RemoveItem(src, "zatminingrack", 1)
end)

CreateUsableItem('zatminingfan', function(source, item)
    local src = source
    itemInfo= {}
    TriggerClientEvent("zat-desktop:client:UseItem", src, "zatminingfan", MiningProps["zatminingfan"].model, itemInfo)
    exports['qs-inventory']:RemoveItem(src, "zatminingfan", 1)
end)

CreateUsableItem('zatbaskets', function(source, item)
    local src = source
    itemInfo= {}
    TriggerClientEvent("zat-desktop:client:UseItem", src, "zatbaskets", MiningProps["zatbaskets"].model, itemInfo)
    exports['qs-inventory']:RemoveItem(src, "zatbaskets", 1)
end)

CreateUsableItem('zatbasketm', function(source, item)
    local src = source
    itemInfo= {}
    TriggerClientEvent("zat-desktop:client:UseItem", src, "zatbasketm", MiningProps["zatbasketm"].model, itemInfo)
    exports['qs-inventory']:RemoveItem(src, "zatbasketm", 1)
end)
```

* Add the code below to qs-inventory/config/metadata.js:<br>

  <pre class="language-javascript"><code class="lang-javascript"><strong>} else if (itemData.name == "zatgpu") {
  </strong>            $(".item-info-title").html("&#x3C;p>" + label + "&#x3C;/p>");
              $(".item-info-description").html(
                  "&#x3C;p>&#x3C;strong>Type: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.type +
                  "&#x3C;/span>&#x3C;/p>&#x3C;p>&#x3C;strong>Performance: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.performance +
                  "&#x3C;/span>&#x3C;/p>&#x3C;p>&#x3C;strong>Freq: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.hz +
                  "&#x3C;/span>&#x3C;/p>"
              );
          } else if (itemData.name == "zatcpu") {
              $(".item-info-title").html("&#x3C;p>" + label + "&#x3C;/p>");
              $(".item-info-description").html(
                  "&#x3C;p>&#x3C;strong>Type: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.type +
                  "&#x3C;/span>&#x3C;/p>&#x3C;p>&#x3C;strong>Performance: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.performance +
                  "&#x3C;/span>&#x3C;/p>"
              );
          } else if (itemData.name == "zatmb") {
              $(".item-info-title").html("&#x3C;p>" + label + "&#x3C;/p>");
              $(".item-info-description").html(
                  "&#x3C;p>&#x3C;strong>Type: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.type +
                  "&#x3C;/span>&#x3C;/p>&#x3C;p>&#x3C;strong>Performance: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.performance +
                  "&#x3C;/span>&#x3C;/p>"
              );
          } else if (itemData.name == "zatps") {
              $(".item-info-title").html("&#x3C;p>" + label + "&#x3C;/p>");
              $(".item-info-description").html(
                  "&#x3C;p>&#x3C;strong>Type: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.type +
                  "&#x3C;/span>&#x3C;/p>&#x3C;p>&#x3C;strong>Performance: &#x3C;/strong>&#x3C;span>" +
                  itemData.info.performance +
                  "&#x3C;/span>&#x3C;/p>"
              );
  </code></pre>
* Copy  the images from \[images] and paste them into qs-inventory/html/images.

</details>

***

## SQL

> Import the sql files from  \[SQLs] folder into your database.

***

## DRONE SOUND

> copy the drone.ogg file into interact-sound/client/html/sounds

## ENSURE RESOURCES

* [ ] ensure zat-desktop
* [ ] ensure zat-desktop\_props
* [ ] ensure zat-gizmo
* [ ] ensure zat-gizmo\_ui


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zat-scripts.gitbook.io/zat-scripts/esx/mining-pc/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
