> For the complete documentation index, see [llms.txt](https://docs.reallifeonline.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reallifeonline.net/rlo-market/configuration.md).

# Configuration

### Main Configuration

```lua
Config = {
    Debug = false, -- debug mode for more information
    VersionCheck = true, -- should this script check for a new version?
    WebHook = 'https://ptb.discord.com/api/webhooks/', -- discord webhook
    LeoJobs = {'police', 'cop', 'marshal'}, -- jobs that cant sell when illegal = true

    DrawDistance = 30.0, -- distance marker should be drawn
    DrawDistanceNPC = 100.0, -- distance ped should be drawn
    InteractDistance = 1.8, -- distance you can access the markers

    RefreshTime = 90 * 60 * 1000, -- refresh for prices (example given: 30 minutes)
    RemainingTime = 0, -- do not change this
    Chance = 20, -- change of double lose or gain
}
```

{% hint style="warning" %}
Enabling **Debug** can cause a **higher resmon usage** due to massive prints.
{% endhint %}

### Translation Configuration

```lua
Translation = { -- Change the Translation Strings here
    ['webhook_username'] = 'STOCKMARKET',
    ['checker_noaccess'] = 'You ~r~do not~s~ have access to this monitor!',
    ['seller_policejob'] = '~r~You are working for the police, what are you doing?',
    ['seller_noaccess'] = 'You ~r~do not~s~ have access to this seller!',
    ['seller_noitem'] = '~r~You do not have any items that this seller wants.',
    ['seller_notenough'] = '~r~You do not have enough.',
}
```

{% hint style="info" %}
You can change this into any language you'd like.
{% endhint %}

### Sound Configuration

{% hint style="danger" %}
**This section is important and can be difficult for some people, if you need assistance don't hesitate to contact us on Discord!**
{% endhint %}

We are going to tear down the whole "Points" Config into various blocks. \
Starting with the first block:

```lua
Points = {
    {
        name = 'food_market', -- intern script name (must be unique)
        label = 'Press ~INPUT_CONTEXT~ to sell to the foodmarket.', -- label for the seller
        infolabel = 'Press ~INPUT_CONTEXT~ to check foodprices.', -- label for the checker
        css = 'sell', -- css from the esx_menu_default header
        illegal = false, -- is this point illegal?
```

{% hint style="info" %}
**The variable "name":** is your *unique* name, it will be used as a "database" for intern operations. In this example its "food\_market".

**The variable "css":** is used to change the header of the menu.

**The variable "illegal":** can either be true/false. If it's set to true the Jobs from the Table "LeoJobs" that you have set in the Main Configuration are not able to sell items at the specific market.
{% endhint %}

In the next block we are taking a look at the items:

```lua
items = {
        {item = 'bread', label = 'Bread', minPrice = 5, maxPrice = 12},
	{item = 'salmon', label = 'Lachs', minPrice = 8, maxPrice = 15},
	{item = 'tomato', label = 'Tomato', minPrice = 2, maxPrice = 5},
	{item = 'apple', label = 'Apple', minPrice = 4, maxPrice = 6},
        {item = 'potato', label = 'Potato', minPrice = 3, maxPrice = 8},
},
```

{% hint style="info" %}
We got a list for every item that should be accepted by the market and be shown in the checkmenu. \
**The variable "item":** Is your item name set in your inventory. That name is also used for the image in the UI.

**The variable "label":** This is the text that will be shown in the UI.

**The variables "minPrice" & "maxPrice":** You can set a minimum price and a maximum price, every set time, the prices will change to a value between those.
{% endhint %}

In the next block we are configurating the checker:

```lua
checker = {
            enable = true, -- enable/disable price checker?
            whitelistJob = false, -- any job required for this point?
            whitelistJobGrade = 0, -- if job required, what grade is minimum?
            coords = vector3(1271.9380, -1712.0483, 54.7714), -- coords

            marker = {
                enable = true, -- enable/disable marker?
                markertype = 29, -- markertype?
                color = {r = 120, g = 255, b = 120} -- rgb color for marker?
            },

            blip = {
                enable = false, -- enable/disable blip?
                sprite = 434,
                colour = 18,
                size = 0.8,
                text = 'Foodmarket Checker'
            }
        },
```

{% hint style="info" %}
We can enable or disable the price checker in here.\
**The variable "whitelistJob":** You can set a job that is required to access that price checker. If you do not want to set a job put it as "false".
{% endhint %}

Next we are configurationg the seller:

```lua
seller = {
            enable = true, -- enable / disable seller
            whitelistJob = false, -- any job required for this point?
            whitelistJobGrade = 0, -- if job required, what grade is minimum?
            coords = vector3(2581.1616, 463.6486, 108.6083), -- coords

            ped = {
                enable = true, -- enable/disable ped?
                model = 'csb_miguelmadrazo', -- Change this to the desired ped model
                rotation = 171.1953 -- rotation of ped?
            },

            blip = {
                enable = true, -- enable/disable blip?
                sprite = 500,
                colour = 69,
                size = 0.7,
                text = 'Foodmarket Seller'
            }
        }
}
```

{% hint style="info" %}
We can enable or disable the seller in here.\
**The variable "whitelistJob":** You can set a job that is required to access that price checker. If you do not want to set a job put it as "false".
{% endhint %}

And thats it! You now got a fully functional market ecosystem. You can add as many of them as you want.

## IMPORTANT LIMITATION

{% hint style="danger" %}
You can put the same item in two different markets, **but you can't give them different prices.** If you still want to do that, we got a secondary table called "JobPoints". You can add a point in there with the same items as another market and can change the prices. So you basically can do 2 markets with the same items but different prices.&#x20;

**So we can say you CAN'T CREATE more than 2 MARKETS with the SAME ITEMS AND PRICE, please keep that in mind.**
{% endhint %}
