# Guide

# Installation

* **ONLY** If you have the `mxc-smoking` map, you need to delete this folder `stream/[props]`

## Dependencies

You must start all dependencies first in your `server.cfg`

* `utility_lib`
* `ox_mysql` (used for `qb-core`. You need that for supporting container items that we provided to you with `Config.VapeSuitcase`)

The script supports ESX and QB and supports different inventories directly, but you can use your custom inventory.

**NOTE**: As we pointed out in `config.lua` container items are supported natively in `quasar advanced inventory`. In the case you don't have the advanced version you can't use `Config.VapeSuitcase` as container item.


## Item Installation

In the `items` folder, configuration files are provided for the supported inventory systems:

* Ox Inventory: `@ox_inventory/data/items.lua`
* Qb Inventory: `@qb-core/shared/items.lua`
* Quasar Inventory: `@qs-inventory/shared/items.lua`


## Add a New Liquid

Go to the `config.lua` file and add the new liquid with this syntax:

```lua
    ["item-name"] = {
        puffs : `number`
} 
```

* The `item-name` will be the name of the item that you need to add to your inventory system.



## Config Variables

* `Config.Debug`: set to `true` if you want to enable debug mode.
* `Config.Target`: set to `true` if you want to use `ox-target` or `qb-target`. Otherwise, set to `false` if you want to use native interactions.
* `Config.CustomTargetResource`: enter the name of the custom target resource you want to use. **REMEMBER** to configure the functions in the `config_functions.lua` file if you are using a custom system.
* `Config.Translations`: customize the translations or leave them as default.
* `Config.SmokingJob`: if you specify a job name, only that job will have exclusive access to the crafting tables; otherwise, anyone will be able to craft their own vape.
* `Config.EnableSmokeTracking`: set to `true` to keep track of the liquid inside the vape. You will only be able to vape if you have inserted a liquid. If you set it to `false`, when the liquid runs out, the color will turn white.
* `Config.SmokeKeybind` is the keybind used for vaping while you have the vape in your hand
* `Config.PutAwayVapeKeybind` is the keybind used for removing the vape from your hands
* `Config.MakeCirclesKeybind` is the keybind used for making circles with the smoke


## Config Tables

You can find all the table descriptions in the `config.lua`, but here's a summary:

* `Config.Locations`: here you have all the locations of mxc-smoking map where you can find workmats for creating your vapes. If you don't have the map, you need to place them (workmats) by yourself.
* `Config.CraftableVapes`: here you have a table that lists all the props used for crafting. Remember that if you change the `item-name` you will also have to do it in your inventory
* `Config.SmokePower`: here you can change the power of all vapes. Higher values of power bigger size of smokes
* `Config.Liquids`: here you can change the number of available puffs that allows you to smoke with that liquid. (Watch `Config.EnableSmokeTracking`)
* `Config.SimpleVapes`: same logic as `Config.CraftableVapes` but these vapes are not used in the workmat.


# Common Issues

* Make sure that the `item-name` entries in the `Config.CraftableVapes`, `Config.SimpleVapes`, and `Config.Liquids` tables are indeed items that you have added to your system. This also applies to `Config.VapeItem1` and `Config.VapeItem2`.
