# Add / Edit Club Things

Let's go inside the <mark style="background-color:orange;">wais-club</mark> folder and open the <mark style="background-color:orange;">Config.lua</mark> file with an editor.

There's a vacant building down there. You can make a quick start by copying and pasting it

```lua
["club-name"] = {
    ["job"] = "",
    ["boss_grade"] = 0, 
    ["debug"] = false,
    ["polyZone"] = {
        ["WallHeight"] = 25,
        ["Zones"] = {
            vec(),
            vec(),
            vec(),
            vec(),
        }
    },
    ["boss_menu"] = {
        ["coords"] = vector3(0.0, 0.0, 0.0),
        ["distance"] = 3,
        ["stash"] = {
            ["use"] = false,
            ["weight"] = 1000,
            ["slots"] = 50,
        },
        ["settings"] = {
            ["label"] = "club-blip-name",
            ["sprite"] = 121,
            ["scale"] = 0.7,
            ["color"] = 48,
            ["coords"] = vector3(0.0, 0.0, 0.0),
            ["work_waitress"] = false,
            ["spotlights"] = {},
            ["animatedNpcs"] = {}
        },
    },
    ["bar_market"] = {
        ["coords"] = vector3(0.0, 0.0, 0.0),
        ["distance"] = 3.0,
        ["items"] = {
            ["foods"] = {
                ["bread"] = {
                    ["price"] = 1,
                    ["label"] = "Bread",
                }
            },
            ["drinks"] = {
                ["water"] = {
                    ["price"] = 1,
                    ["label"] = "Water",
                }
            },
        }
    },
    ["tables"] = {
        [1] = {
            ["club"] = "club-name",
            ["textZ"] = 0.0,
            ["coords"] = vector3(0.0, 0.0, 0.0),
            ["radius"] = 2.0,
        },
    },
    ["dj_cabin"] = {
        ["coords"] = vector3(0.0, 0.0, 0.0),
        ["distance"] = 3.0,
        ["music_coords"] = vector3(0.0, 0.0, 0.0),
        ["music_maxDistance"] = 40.0,
    },
},
```

***

{% hint style="danger" %}
**‘club-name**’ must be unique. Give it a simple and meaningful name as it will be used in the sql table and in some code inside.
{% endhint %}

## Job integration 💼

Don't forget to add Job making sure it is not used for another club.

* You must enter your job name where it says <mark style="background-color:orange;">‘your-job-name-here’</mark>

<mark style="background-color:orange;">Boss\_grade:</mark> Written for ESX, In ESX, <mark style="background-color:orange;">you have to write the boss grad of the job here</mark>. Thus, it will be known whether the person is boss or not. For <mark style="background-color:orange;">QBCore</mark> and <mark style="background-color:orange;">Qbx</mark> you can write <mark style="background-color:orange;">0 or nil here</mark>

<pre class="language-lua"><code class="lang-lua"><strong>["job"] = "your-job-name-here",
</strong>["boss_grade"] = 0, 
</code></pre>

* <mark style="background-color:yellow;">Add Job For QBCore/Qbx</mark>
  * Go to this location: ***qb-core/shared/jobs.lua***
  * Go to the bottom line and add the new job with the correct syntax.&#x20;
  * Below is an example.

    ```lua
    your-job-name = {
    	label = 'Job Label',
    	type = 'club',
    	defaultDuty = false,
    	offDutyPay = false,
    	grades = {
    		['0'] = { name = 'Waiter', payment = 50 },
    		['1'] = { name = 'Employee', payment = 75 },
    		['2'] = { name = 'Assistant', payment = 100 },
    		['3'] = { name = 'Director', payment = 125 },
    		['4'] = { name = 'Boss', isboss = true, payment = 150 },
    	},
    },
    ```
* <mark style="background-color:yellow;">Add Job For ESX</mark>
  * Go to your sql table and find the ***jobs*** table.
  * <mark style="background-color:orange;">Name</mark>: The job name you created for the club.
  * <mark style="background-color:orange;">Label</mark>: Your job label
  * Visit ***Job\_grades*** and add a grade by adding a new stune according to the name you created

***

## Polyzone / Debug

You must enter the coordinates of the polzyzone, where the area consists simply of 4 sides.

&#x20;If the MLO / YMAP has a very different shape, you can get a more stable structure by entering a detailed coordinate operation

* <mark style="background-color:orange;">**Debug**</mark>: By making True, you can see the target, polyzone and other points in the area with a red circle
* <mark style="background-color:orange;">**WallHeight**</mark>: Keep 25 by default. This is the height level of the Polyzone.

***

## Boss Menu / Stash / Blips & Club Settings 🔩

{% hint style="warning" %}
When the script is first started, if the club is not in the sql table, it is registered in sql. Then the boss menu changes in config (aniamtedNpcs, spotlights, blip sptire and colour) will not be changed. Because it will work with data from sql
{% endhint %}

* <mark style="background-color:orange;">**Coords, Distance**</mark>: The coordinate to access the boss menu and the interaction distance for this area. It cannot be opened with the command, you can only open it in that area in the club
* <mark style="background-color:orange;">**Stash**</mark>: If you set <mark style="background-color:orange;">\["use"]</mark> to false, you will not be able to access the custom repository for the venue from the boss menu.
* <mark style="background-color:orange;">**Settings**</mark>: There are many modifiable variables related to the Club.
  * <mark style="background-color:yellow;">Label</mark>: The default blips name on the map
  * <mark style="background-color:yellow;">Sprite</mark>: Default blips view on the map. You can access the sprites [here](https://docs.fivem.net/docs/game-references/blips/)
  * <mark style="background-color:yellow;">Scale</mark>: Default blips size on the map.
  * <mark style="background-color:yellow;">Coords</mark>: The location of the blip on the map.
  * <mark style="background-color:yellow;">Work\_waitress</mark>: If `true`, drinks and food should be taken from the tables in the club by calling the waiter. If `false`, people can access the bar menu by looking at the table with Target.
  * <mark style="background-color:yellow;">Spotlights</mark>: Placing the light by default is quite excusable.Therefore, I do not recommend putting light in the default state, you can easily handle it with Creator. <mark style="background-color:orange;">**Do not touch or delete!**</mark>&#x20;
  * <mark style="background-color:yellow;">AnimatedNpcs</mark>: It is in a way that you can place npc by default. If you do not want to, you can provide npc placement with Creator.  Below is a default table structure. You can add it by editing it. Remember, the changes you will make after this club is registered to sql will not work. [Ped models](https://docs.fivem.net/docs/game-references/ped-models/)
  * <pre class="language-lua"><code class="lang-lua"><strong>["npc-short-name"] = {
    </strong>    class = nil,
        name = "NPC Label",
        model = "a_f_m_beach_01",
        anim = "anim name",
        dict = "anim directory",
        canDoAnim = false, -- If you make True, it will do the animation you wrote
        coords = vector3(0.0, 0.0, 0.0),
        heading = 0.0,
    },
    </code></pre>

***

## Bar Market / Shop System 💸

It operates within the entered position and control distance. It does not open with command. Received products can be printed as invoice to the table according to `work_waitress` status.

{% hint style="info" %}
Invoices or the prices of the products received at the tables are defined to the Club Society.
{% endhint %}

{% hint style="warning" %}
There must be a ‘Drinks’ and ‘Foods’ category in the item table. It is not suitable to add more categories at the moment.
{% endhint %}

* The item you add must definitely be in the Core or Inventory item table. If not, you may get an error or you may not see the item.
* Item prices will be actively displayed in the bar system and will go to the Club's society in case of purchase

***

## Tables / Service 👨🏼‍💼

ID, Coordinate and Radius of the tables that will receive service in the club are required.&#x20;

{% hint style="danger" %}
Make sure to take the table coordinate from the centre and set the Z position correctly.
{% endhint %}

* <mark style="background-color:orange;">Club</mark>:The first short club name you wrote. It must belong to the club itself, do not write another club short name
* <mark style="background-color:orange;">TextZ</mark>:Value of Height to be Added to make it easier for employees to see the number of desks
* <mark style="background-color:orange;">Coords, Radius</mark>:Coordinate and width of the table

***

## DJ Cabinet / Music System 🎼

{% hint style="info" %}
Only YouTube URLs are supported.
{% endhint %}

The DJ Cabinet works with ‘[<mark style="background-color:orange;">**xsound**</mark>](https://github.com/Xogy/xsound)’. Favourite songs or other changes are instantly updated to other people in the job.

Songs cannot be looped. Forward or Back buttons have no function.

* <mark style="background-color:orange;">Coords, Distance</mark>:Location and interaction area to access the DJ Cabinet
* <mark style="background-color:orange;">Music Coords, Distance</mark>: The main position and width of the music to be played. I recommend you to be sensitive about the width. Take coordinates from a location where there is as much interaction as possible
