> For the complete documentation index, see [llms.txt](https://acestudios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acestudios.gitbook.io/docs/jobs-and-economy/date-farming-job/configuration.md).

# Configuration

Configure ace\_datepackagingJob through config.lua, bridges and locales.

All gameplay settings are in `ace_datepackagingJob/config.lua`.

## Main settings

| Option               | Type    | Default       | Values                                                                             |
| -------------------- | ------- | ------------- | ---------------------------------------------------------------------------------- |
| `Config.Debug`       | boolean | `false`       | Prints `[DateJob Debug]` messages, including the detected framework and inventory. |
| `Config.Locale`      | string  | `'en'`        | `'en'`, `'ar'`, `'de'`, `'es'`, `'fr'`, `'ru'`, `'tr'` (files in `locales/`).      |
| `Config.Framework`   | string  | `'auto'`      | `'auto'`, `'esx'`, `'qbcore'`, `'qbox'`                                            |
| `Config.Inventory`   | string  | `'auto'`      | `'auto'`, `'ox'`, `'qb'`, `'qs'`, `'lj'`, `'ps'`, `'codem'`, `'core'`, `'none'`    |
| `Config.Interaction` | string  | `'qb-target'` | `'ox_target'`, `'qb-target'`, `'marker'`, `'3dtext'`                               |

{% hint style="warning" %}
`Config.Interaction` defaults to **`'qb-target'`**. If you use ox\_target, or don't use a target resource, change it to `'ox_target'`, `'marker'` or `'3dtext'`.
{% endhint %}

### Auto-detection order

| Setting              | Checked in order                                                                                                          |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Framework (`'auto'`) | `qb-core` → `es_extended` → `qbx_core`                                                                                    |
| Inventory (`'auto'`) | `ox_inventory` → `qs-inventory` → `qb-inventory` → `lj-inventory` → `ps-inventory` → `codem-inventory` → `core_inventory` |

{% hint style="info" %}
**Qbox servers:** Qbox can run a `qb-core` compatibility bridge. If `qb-core` shows as started, auto-detection picks `qbcore` first. Set `Config.Framework = 'qbox'` to force Qbox.
{% endhint %}

## Gameplay

```lua
Config.Settings = {
    TreeCooldown = 300,
    MaxDistCheck = 5.0,
    InteractionDist = 2.5,
    ScannerTick = 1500
}

Config.HarvestYield = { min = 2, max = 5 }
Config.BasePrice = 100
```

| Option            | Default | Description                                                                                       |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------- |
| `TreeCooldown`    | `300`   | Seconds before the same tree can be harvested again.                                              |
| `MaxDistCheck`    | `5.0`   | Server-side anti-exploit: maximum distance allowed between the player and the object.             |
| `InteractionDist` | `2.5`   | Interaction distance.                                                                             |
| `ScannerTick`     | `1500`  | Milliseconds between scans for nearby props. **Only used with `marker` or `3dtext` interaction.** |
| `HarvestYield`    | `2`–`5` | Raw dates per harvest (random between `min` and `max`).                                           |
| `BasePrice`       | `100`   | Base sale price of one packaged date. The final price is `BasePrice × priceMultiplier`.           |

## Items

```lua
Config.Items = {
    RawDate = 'raw_dates',
    CleanDate = 'clean_dates',
    PackagedDate = 'packaged_dates'
}
```

Change these if your item names are different.

## Qualities

```lua
Config.Qualities = {
    { grade = "Normal",  weight = 60, priceMultiplier = 1.0 },
    { grade = "Premium", weight = 30, priceMultiplier = 1.5 },
    { grade = "Export",  weight = 10, priceMultiplier = 2.5 }
}
```

| Field             | Description                                      |
| ----------------- | ------------------------------------------------ |
| `grade`           | Grade name. It's referenced by farming zones.    |
| `weight`          | Relative chance. Higher numbers are more likely. |
| `priceMultiplier` | Multiplies `BasePrice` when selling.             |

## Farming zones

```lua
Config.AllowHarvestOutsideZones = false

Config.FarmingZones = {
    {
        id = "island_tier_3",
        name = "Medium Tier Area (Tier 3)",
        coords = vec3(3846.8970, 106.2089, 65.1983),
        radius = 110.0,
        qualities = {
            { grade = "Normal",  weight = 45 },
            { grade = "Premium", weight = 45 },
            { grade = "Export",  weight = 10 }
        }
    },
}
```

| Field               | Description                                                                               |
| ------------------- | ----------------------------------------------------------------------------------------- |
| `id`                | Unique zone ID.                                                                           |
| `name`              | Display name.                                                                             |
| `coords` / `radius` | Zone center and radius in meters.                                                         |
| `qualities`         | Weighted grades available in this zone. `grade` must match a grade in `Config.Qualities`. |

`AllowHarvestOutsideZones = false` stops players harvesting trees outside every zone. They see *"This palm tree belongs to a zone where harvesting is banned or infertile."*

### Default tiers

| Zone                      | Radius | Grade weights                      |
| ------------------------- | -----: | ---------------------------------- |
| Low Tier Area (Tier 1)    |    150 | Normal 85                          |
| Common Tier Area (Tier 2) |    150 | Normal 65 · Premium 30             |
| Medium Tier Area (Tier 3) |    110 | Normal 45 · Premium 45 · Export 10 |
| Premium Tier              |    130 | Premium 55 · Export 20             |
| Export Tier               |    130 | Export 50                          |

## Models

```lua
Config.Models = {
    Trees = { `prop_palm_med_01b`, `prop_palm_med_01c`, `prop_palm_sm_01e`, `prop_palm_med_01d` },
    CleanMachines = { `ace_datecleaning_machine` },
    PackageMachines = { `ace_datewrapping_machine` }
}
```

These models are the trees and machines players interact with. Add more model hashes to use other palm trees or machine props.

## Selling NPC

```lua
Config.Locations = {
    SellingNPC = {
        coords = vec4(3869.7288, -276.6280, 28.2835, 359.0848),
        model = `a_m_m_farmer_01`,
        blip = { enabled = true, sprite = 280, color = 2, scale = 0.8, label = "Date Exporter" }
    }
}
```

Players are paid in **cash** (`cash` account on QBCore/Qbox, `addMoney` on ESX). See `bridge/server.lua`.

## Animations & processing

| Step      | Default duration | Input → output                                 | Keys                                     |
| --------- | ---------------- | ---------------------------------------------- | ---------------------------------------- |
| `Harvest` | 5000 ms          | Tree → `HarvestYield` raw dates                | `dict`, `anim`, `flag`, `prop` (machete) |
| `Clean`   | 8000 ms          | `reqRawDates = 5` → `yieldCleanDates = 5`      | `dict`, `anim`, `flag`                   |
| `Package` | 10000 ms         | `reqCleanDates = 5` → `yieldPackagedDates = 1` | `dict`, `anim`, `flag`                   |

## Webhook

```lua
Config.Webhook = {
    Enabled = false,
    Url = "YOUR_DISCORD_WEBHOOK_URL",
    BotName = "Date Factory Logs",
    Color = 16753920
}
```

## Locales

Translations are JSON files in `locales/`. To add a language, copy `en.json` to a new file (for example `pt.json`), translate the values, and set `Config.Locale = 'pt'`. Keep placeholders such as `%d` and `%s`.

## Bridges

These files are **not** escrowed, so you can adapt them to a custom framework or inventory:

| File                   | Purpose                                                                      |
| ---------------------- | ---------------------------------------------------------------------------- |
| `bridge/client.lua`    | Framework detection (client), `Notify()` via `lib.notify`                    |
| `bridge/server.lua`    | Framework detection (server), `GetPlayer`, `GetIdentifier`, `AddMoney`       |
| `inventory/server.lua` | Inventory detection, `HasItem`, `AddItem`, `RemoveItem`, `GetInventoryItems` |
| `shared/utils.lua`     | Debug logging helper                                                         |
