# Shops

## Shop Creator Configuration

{% hint style="info" %}
First you need to configure `Config.ShopCreator` found inside: `t1ger_tuningsystem/shared/config.lua`
{% endhint %}

```lua
Config.ShopCreator = {
	UseSocietyAccounts = true, -- set true to use qb-banking (must update to latest) or esx_addonaccounts instead of custom account column from the database table.
	Blip = {input = true, sprite = 446, display = 4, scale = 0.75, color = 5}, -- if input = true, set sprite/color in-game, else define settings here to apply for created shop
	Grades = { -- default job grades that are created, once a shop is being created
		{grade = 0, name = 'recruit', label = 'Recruit', salary = 50},
		{grade = 1, name = 'employee', label = 'Employee', salary = 75},
		{grade = 2, name = 'boss', label = 'Boss', salary = 100, isboss = true}
		-- make sure boss grade is the very last one and has the 'isboss = true' as the only one!
	},
	DefaultDuty = true, -- QB CORE ONLY - set default duty on qb core jobs (doesnt matter for esx)
	OffDutyPay = false, -- QB CORE ONLY - set off duty payment on qb core jobs (doesnt matter for esx)
}
```

* **UseSocietyAccount:** `boolean`
  * If this option is set to true, it will use [society-account](https://docs.t1ger.net/resources/t1ger-library/installation/society-account "mention") (click for setup/guide) or if set to false, it will use the built-in custom column for account management.&#x20;
* **Blip:** `table`
  * Creates a blip with the given settings.
  * input: `boolean` - if input is true, admins can select blip color and sprite in-game when creating a shop. If false, it will read blip settings from here.
  * sprite: `number` - [reference](https://docs.fivem.net/docs/game-references/blips/#blips)
  * display: `number` - [reference](https://docs.fivem.net/natives/?_0x9029B2F3DA924928)
  * scale: `number` - [reference](https://docs.fivem.net/natives/?_0xD38744167B2FA257)
  * color: `number` - [reference](https://docs.fivem.net/docs/game-references/blips/#blip-colors)
* **Grades:** `table`
  * This table sets the default grades for each created job during the shop creation. You edit the current grades, add or remove grades. Just make sure the last grade (boss grade) has the `isboss = true` parameter.&#x20;
  * grade: `number` - first one must always be 0
  * name: `string` - no capital letters, spaces or special chars!
  * label: `string`
  * salary: `number`
  * isboss: `boolean` - only use for the very last grade
* **DefaultDuty:** `boolean`
  * Set default duty on jobs (only applicable for QBCore)
* **OffDutyPay:** `boolean`
  * Set off duty salary/payment (only applicable for QBCore)

## Tuner Admin Menu <a href="#create-shop" id="create-shop"></a>

In order to create a shop you must use the 'tuner-admin-menu'.&#x20;

<div align="left"><figure><img src="https://2167335559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiDWIMbFBeXle-trOlk%2Fuploads%2F4WKjuMFoSbpkict1FugL%2Fimage.png?alt=media&#x26;token=df1d631a-4e54-4557-a770-bc95bc29dc25" alt=""><figcaption><p>Main menu of tuner-admin-menu</p></figcaption></figure></div>

{% hint style="warning" %}
if you can't open the admin menu, even though you are admin - then make sure you have configured `Config.AcePermission` in `t1ger_lib/config.lua`
{% endhint %}

You can configure command & keybind to access the menu (`Config.AdminMenu` found inside: `t1ger_tuningsystem/shared/config.lua`) :

```lua
Config.AdminMenu = {
	Command = {enable = true, string = 'admintuner'}, -- enable/disable command, set command string.
	Keybind = {enable = true, defaultMapping = 'F10', description = 'Open admin tuner menu'} -- enable/disable keybind, set default mapping (players edit button in-game inside GTA Settings)
}
```

* **Command:** `table`
  * enable: `boolean` - enable/disable command?
  * string: `string` - chat-command to open the menu
* **Keybind:** `table`
  * enable: `boolean` - enable/disable command?
  * defaultMapping: `string` - keybind to open menu
  * description: `string` - keybind description

## Shop Creation

If you click on Create Tuner Shop, this pop-up will appear, which you have to fill out:&#x20;

<div align="left"><figure><img src="https://2167335559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiDWIMbFBeXle-trOlk%2Fuploads%2Fewe6AqGMHDBl8XqNoJMk%2Fimage.png?alt=media&#x26;token=a35fa692-f041-4ae9-960c-f74a50214ca9" alt=""><figcaption><p>In-game shop creator menu</p></figcaption></figure></div>

* **Shop Name:** `string`
  * Give your shop a name, for example: `T1GER Tuner Shop` or `Los Santos Customs`
* **Job Name:** `string`
  * This is the job name used for the shop. Make sure it's lowercase characters, no special characters and no spaces. You can use existing jobs from your server, simply just enter the correct job name. Examples of job names: `t1gertuner`, `mechanic`, `lscustom`, `tuner`.
* **Job Label:** `string`
  * Give your created job a label, for example: T1GER Tuner, LS Tuner, Custom Tuner and so on. Keep in mind, if you've entered an existing job in `Job Name`, then the script will auto-read the job label from that job.
* **Account Start Balance:** `number`
  * You can give the tuner shop some money to start off with, simply enter the amount in this field.
* **Select Mod Categories:** `table`
  * You can restrict what categories this shop has access to by selecting from the drop-down menu. Simply select all categories to give them access to all categories. This allows to create wheels only shop, respray only shops and so on.
* **Blip Coords:** `array`
  * Shop coords will be the position of the admin that creates the shop.
* **Enable Blip:** `boolean`
  * Check the field to either enable/disable a blip for this shop. Maybe you want to create a secret tuner shop on the map?
* **Blip Sprite:** `number`
  * Set the sprite of the blip in this field. Use this link as reference for blip sprite ids: <https://docs.fivem.net/docs/game-references/blips/#blips>
* **Blip Color:** `number`
  * Set the color of the blip in this field. Use this link as reference for blip color ids: <https://docs.fivem.net/docs/game-references/blips/#blip-colors>

{% hint style="warning" %}
If you are using **`qb-core`** and you feel like your created jobs aren't syncing properly with 3rd-party resources (phones, doorlocks and etc.), then refer to [6 - (Automatic) Job Creation](https://docs.t1ger.net/resources/t1ger-tuning-system/installation#id-6-automatic-job-creation) for a workaround solution.
{% endhint %}

## Shop Management

In order to manage shops there must be shops to manage. If you haven't learned or created any shops, please refer to [#shop-creation](#shop-creation "mention"). You can manage shop in the same `tuning-admin-menu`, by clicking on `view tuner shops`.

<div align="left"><figure><img src="https://2167335559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiDWIMbFBeXle-trOlk%2Fuploads%2FKOI89fWCSN7ehlJKNDVF%2Fimage.png?alt=media&#x26;token=114f4a6c-4429-4343-af5c-a3a11708cff4" alt=""><figcaption><p>Overview of shops</p></figcaption></figure></div>

Once you've clicked on a shop to manage, you should see a menu like this:

<div align="left"><figure><img src="https://2167335559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiDWIMbFBeXle-trOlk%2Fuploads%2FpPrWtcntH4OfRFyN9IJU%2Fimage.png?alt=media&#x26;token=60cb3dec-e7d7-4303-b462-1f8247fb75d9" alt=""><figcaption><p>Manage selected shop menu</p></figcaption></figure></div>

* **Set Boss:** This sub-menu allows to set a boss to a newly created shop, replace a boss with a new boss or just remove the boss.&#x20;
* **Set Account Balance:** You can update the shop's account balance with this option.&#x20;
* **Set Mod Categories:** If the shop needs access to more mod categories or need some taken away, this is the option to use!
* **Marker Management:** With this option you can manage markers, create, delete and/or edit them.
* **Delete Shop:** This option is used to delete the shop entirely from the server.&#x20;
