# Configuration

Complete configuration reference for the Lite Jobs Pack.

***

## Configuration Files

The script uses configuration files located in the `shared/` folder:

| File                  | Purpose                                            |
| --------------------- | -------------------------------------------------- |
| `shared/config.lua`   | Main configuration (framework, features, systems)  |
| `shared/jobs/*.lua`   | Individual job settings (NPC, payment, XP, routes) |
| `server/editable.lua` | Discord webhook settings                           |

***

## Basic Settings

### Framework & Core

```lua
-- Framework Selection
-- Options: 'qb', 'esx', 'vrp', 'vrp2', 'standalone'
Config.Framework = "qb"

-- Database Resource
-- Options: 'oxmysql', 'mysql-async', 'ghmattimysql'
Config.SQL = "oxmysql"

-- Inventory System
-- Options: 'qb_inventory', 'esx_inventory', 'ox_inventory', 'qs_inventory'
Config.Inventory = "qb_inventory"

-- Language (Available: 'en', 'tr', 'de', 'fr', 'pt', 'ru', 'es', 'nl')
Config.Locale = "en"

-- Currency Display Symbol
Config.CurrencySymbol = "$"

-- Event Prefix (used for internal events)
Config.EventPrefix = "tw-litejobpack"
```

{% hint style="info" %}
**QBox Users:** QBox is fully compatible. Set `Config.Framework = 'qb'` for QBox servers.
{% endhint %}

***

## Debug Settings

```lua
-- Development Mode (enables extra logging)
Config.DevMode = false

-- Debug Mode (shows console messages)
Config.Debug = false

-- Test Mode (enables test commands)
Config.Test = false
```

{% hint style="warning" %}
**Production Servers:** Always set `Config.DevMode`, `Config.Debug`, and `Config.Test` to `false` for better performance!
{% endhint %}

***

## Lobby Settings

```lua
Config.Lobby = {
    maxPlayers = 3,          -- Maximum players per lobby (1-3)
    inviteRadius = 8.0,      -- Radius to detect nearby players for invite
    inviteTimeout = 30,      -- Seconds before invite expires
    kickCooldown = 5,        -- Cooldown between kicks (seconds)
    inviteCooldown = 10,     -- Cooldown between invites (seconds)
}
```

***

## Target System

```lua
Config.TargetSystem = {
    enabled = false,                -- Enable/disable target interaction
    resource = "auto",              -- "auto", "ox_target", "qb-target"
    icon = "fas fa-briefcase",      -- Icon for job interactions
    jobCenterIcon = "fas fa-building",  -- Icon for job center NPC
}
```

***

## NPC Camera

```lua
Config.NPCCamera = {
    enabled = true,          -- Enable camera zoom on NPC interaction
    hidePlayer = true,       -- Hide player model during camera
    distance = 2.3,          -- Camera distance from NPC
    sideOffset = 0.0,        -- Horizontal offset
    height = 0.3,            -- Camera height offset
    fov = 25.0,              -- Field of view
    pitch = 5.0,             -- Camera pitch angle
    transitionMs = 500,      -- Transition duration in milliseconds
}
```

***

## Feature Toggles

### Quality System

Adds tiered loot quality with level-based bonuses.

```lua
Config.QualitySystem = {
    enabled = false,
    levelChanceBonus = 0.5,     -- Bonus chance per level
    levelPayBonus = 0.02,       -- Bonus pay multiplier per level

    defaultTiers = {
        { name = "Common",    chance = 55, multiplier = 1.0 },
        { name = "Uncommon",  chance = 25, multiplier = 1.3 },
        { name = "Rare",      chance = 13, multiplier = 1.8 },
        { name = "Legendary", chance = 7,  multiplier = 2.5 },
    },
}
```

### Dynamic Economy

Supply and demand system that adjusts item prices automatically.

```lua
Config.Economy = {
    enabled = false,
    recoveryInterval = 10,       -- Stock recovery interval (minutes)
    MinMultiplier = 0.5,         -- Minimum price multiplier
    MaxMultiplier = 2.0,         -- Maximum price multiplier

    BaseStocks = {
        ['coal_ore'] = 2000,
        ['iron_ore'] = 1000,
        ['gold_ore'] = 500,
        ['emerald_ore'] = 300,
        ['diamond_ore'] = 200,
        ['wood_log'] = 1500,
        ['metal_scrap'] = 2000,
        ['meat'] = 3000,
        -- ... more items
    }
}
```

### Global Events

Server-wide special events with collective goals and rewards.

```lua
Config.GlobalEvents = {
    enabled = false,
    events = {
        {
            id = "clean_city",
            jobId = "cleanup",
            title = "City Cleanup Initiative",
            description = "The mayor has ordered a city-wide cleanup!",
            target = 500,
            reward = { money = 5000, xp = 1000 }
        },
    }
}
```

### Job Cooldown

Prevents players from spamming jobs.

```lua
Config.JobCooldown = {
    enabled = false,
    mode = "perJob",         -- "perJob" or "global"
    duration = 120,          -- Cooldown in seconds
}
```

### Coop Payment

Configure team payment bonuses.

```lua
Config.CoopPayment = {
    enabled = false,
    mode = "full",           -- "full" (everyone gets full pay) or "split"
    bonus = 1.2,             -- 1.2x bonus for coop play
}
```

### Daily Bonus

Random daily bonus jobs with increased pay.

```lua
Config.DailyBonus = {
    enabled = false,
    bonusJobCount = { min = 1, max = 3 },     -- Number of bonus jobs per day
    bonusRange = { min = 1.25, max = 1.50 },   -- Pay multiplier range
    excludeJobs = {},                           -- Job IDs to exclude
}
```

### Coop Leaderboard

Team-based rankings visible in the UI.

```lua
Config.CoopLeaderboard = {
    enabled = true,
    broadcastInterval = 5000,    -- Update interval in milliseconds
}
```

### Weather Impact

Adjust job payments based on in-game weather.

```lua
Config.WeatherImpact = {
    enabled = false,
    reportInterval = 60000,      -- Weather check interval (ms)
    rules = {
        RAIN    = { default = 1.0, cleaner = 0.85, farmer = 1.20, landscaping = 1.20 },
        THUNDER = { default = 1.0, miner = 1.15, lumberjack = 1.15, scrapyard = 1.15 },
        FOGGY   = { default = 1.0, delivery = 1.15, trucker = 1.15, newspaper = 1.15 },
        SNOW    = { default = 1.0, powerlines = 1.20, fishing = 0.80, diving = 0.80 },
        CLEAR   = {},
        EXTRASUNNY = { default = 1.0, farmer = 1.10, fruitpicker = 1.10 },
    },
}
```

### Shift System

Time-based payment multipliers.

```lua
Config.ShiftSystem = {
    enabled = false,
    shifts = {
        morning   = { label = "Morning Shift",   hours = { 6, 12 },  rules = { default = 0.90 } },
        afternoon = { label = "Afternoon Shift",  hours = { 12, 18 }, rules = { default = 1.00 } },
        evening   = { label = "Evening Shift",    hours = { 18, 24 }, rules = { default = 1.15 } },
        night     = { label = "Night Shift",      hours = { 0, 6 },   rules = { default = 1.30, diving = 0.80 } },
    },
}
```

### Referral Bonus

Reward players for inviting others to jobs.

```lua
Config.ReferralBonus = {
    enabled = false,
    xpReward = 150,              -- XP reward for referral
    maxBonusesPerDay = 5,        -- Daily limit
}
```

### Achievements

Track player milestones with Discord webhook support.

```lua
Config.Achievements = {
    enabled = true,
    discordWebhook = true,
    list = {
        { id = "miner_lv5",      label = "Master Miner",      jobId = "miner",      type = "level", target = 5,  xpReward = 500 },
        { id = "miner_lv10",     label = "Mining Legend",      jobId = "miner",      type = "level", target = 10, xpReward = 2000 },
        { id = "fishing_lv5",    label = "Expert Angler",      jobId = "fishing",    type = "level", target = 5,  xpReward = 500 },
        { id = "trucker_lv5",    label = "Road King",          jobId = "trucker",    type = "level", target = 5,  xpReward = 500 },
        -- ... more achievements for each job
    }
}
```

***

## UI Positioning

Customize UI element positions. Players can also drag panels in-game.

```lua
Config.DefaultUIPositionsVersion = 2
Config.DefaultUIPositions = {
    jobProgressPanel        = { bottom = '12.00vh', right = '1.00vw', locked = false },
    coopLeaderboardPanel    = { top = '12.00vh', right = '1.00vw', locked = false },
    drawTextContainer       = { top = '47.65vh', right = '1.80vw', locked = false },
    actionProgressContainer = { bottom = '18.00vh', left = '48.54vw', locked = false },
    finishJobModal          = { top = '35.00vh', right = '8.00vw', locked = false },
}
```

* `locked = true` — Panel stays at the configured position, player cannot move it
* `locked = false` — Player can drag and save a custom position
* Increment `DefaultUIPositionsVersion` when changing positions to reset player overrides

{% hint style="info" %}
Players can adjust UI positions in-game through the settings menu!
{% endhint %}

***

## Disabling / Enabling Individual Jobs

Each job can be toggled on or off in its own config file (`shared/jobs/<jobname>.lua`):

```lua
enabled = true,   -- Set to false to disable this job completely
```

When disabled:

* The job NPC will **not** spawn
* The job blip will **not** appear on the map
* Players **cannot** start the job

{% hint style="info" %}
You can also disable/enable jobs at runtime through the Admin Panel's Job Editor without restarting the server.
{% endhint %}

***

## Miscellaneous Settings

```lua
-- Prevent entering vehicles while holding a job tool
Config.PreventVehicleWithTool = true

-- Force first-person view during break sessions
Config.BreakSessionFirstPerson = false

-- Require a specific job to access the pack
Config.RequireSelectedJob = false
Config.RealJob = 'none'
```

***

## Admin Panel

The Lite Jobs Pack includes a powerful admin panel for managing jobs, players, and the economy at runtime.

### Access Configuration

```lua
Config.AdminPanel = {
    acePermission = "admin",                -- ACE permission required
    identifierWhitelist = {                 -- Or whitelist specific identifiers
        -- "steam:xxxxxxxxxxxxx",
    },
}
```

Access the admin panel with the `/jobadmin` command (configurable).

### Dashboard

The admin dashboard provides real-time statistics:

* **Economy Overview** — Total money and XP earned (today, this week, all-time)
* **Job Breakdown** — Revenue and unique player counts per job
* **Active Lobbies** — Current coop sessions with player lists
* **Market Prices** — Live supply/demand multipliers for all items
* **Online Players** — Current player count

### Player Management

* **Search Players** — Find by name or identifier (online and offline)
* **Player Statistics** — View job levels, total XP, recent job history (last 20 jobs)
* **Set Player Level** — Manually adjust a player's job level (1 to max)
* **Set Perk Points** — Adjust a player's perk point balance

### Economy Management

* **View Pay Rates** — See payment modes, item prices, quality tiers for every job
* **Set Market Multipliers** — Adjust supply/demand pricing per item
* **Reset Market** — Reset individual items or all market prices to base values
* **Save Economy Config** — Persist changes directly to job config files

{% hint style="info" %}
Economy changes are validated before saving — values must be within 0-100,000 range and quality tier chances must sum to 100%.
{% endhint %}

### Job Editor (Runtime)

Admins can edit job configurations at runtime without server restart:

* **NPC Settings** — Model, scenario, coordinates, interaction distance, blip label
* **Vehicle Settings** — Model, plate, colors, spawn locations
* **Location Coordinates** — Processing station, work clothes, finish area
* **Spawn Points** — Rock spawns, tree spawns, area spots
* **Job State** — Enable/disable individual jobs

{% hint style="warning" %}
The Job Editor requires `Config.DevMode = true` or admin permission. Changes are saved directly to the job config files.
{% endhint %}

### Discord Logging

Configure Discord webhooks for admin action logging in `server/editable.lua`:

```lua
DiscordLogConfig = {
    enabled = true,
    botName = "tw-litejobpack",
    botToken = "",                   -- Your Discord bot token
    webhooks = {
        jobFinish = "",              -- Webhook for job completions
        jobLog = "",                 -- Webhook for admin actions
        achievement = "",            -- Webhook for achievements
    },
}
```

***

## Individual Job Configuration

Each job has its own configuration file in `shared/jobs/`. Every job file follows a consistent structure:

### Job Metadata

```lua
{
    id = "miner",
    name = "Miner",
    subtitle = "Underground Mining Operations",
    enabled = true,                          -- Toggle job on/off
    icon = "./img/jobs/miner_icon.svg",
    image = "./img/jobs/miner_bg.png",
    video = "https://...",                   -- Promotional video URL
}
```

### NPC Configuration

```lua
npc = {
    enabled = true,
    coords = vector4(2944.13, 2743.39, 43.3, 349.75),
    model = "s_m_y_construct_02",
    scenario = "WORLD_HUMAN_CLIPBOARD",
    interaction = {
        distance = 2.0,
        key = 38,
        keyLabel = "[E]",
        text = "Start Mining Job",
    },
    blip = {
        enabled = true,
        sprite = 618,
        color = 28,
        scale = 0.8,
        label = "Mining Job",
    },
}
```

### Payment Modes

Jobs use one of four payment modes:

| Mode         | Description                                    | Example Jobs              |
| ------------ | ---------------------------------------------- | ------------------------- |
| `"onJobEnd"` | Pay on job completion based on items collected | Miner, Farmer, Scrapyard  |
| `"distance"` | Pay based on distance traveled                 | Trucker, Taxi, Dog Walker |
| `"custom"`   | Custom payment logic per action                | Fishing, Powerlines       |
| Per-item     | Pay per individual task completed              | Cleaner, Delivery         |

```lua
-- Example: On Job End (Miner)
payment = {
    mode = "onJobEnd",
    completionBonus = 0,
    coopMode = "full",
}

-- Example: Distance-based (Trucker)
payment = {
    mode = "distance",
    perHundredMeters = 10,
    illegalMultiplier = 2.0,
    maxDamageDeduction = 0.5,
    coopMode = "full",
}

-- Example: Custom (Fishing)
payment = {
    mode = "custom",
    deliveryBonus = 150,
    completionBonus = 0,
    coopMode = "full",
}
```

### XP Rewards

```lua
xprewards = {
    oreExtracted = 25,        -- XP per ore extracted
    jobCompleted = 500,       -- XP on job completion
}
```

### Vehicle Configuration

```lua
runtime = {
    vehicle = {
        model = "bison",
        plate = "MINER",
        fuelOnSpawn = 100.0,
        color = { primary = 6, secondary = 0 },
        spawnLocations = {
            vector4(2952.47, 2748.95, 43.50, 278.43),
            vector4(2953.36, 2743.02, 43.50, 278.43),
        },
        trunkDoors = { 5 },
        toolPositions = { ... },
        cargoPositions = { ... },
    },
}
```

### Quality Tiers (Per-Job Override)

Individual jobs can override the global quality system:

```lua
qualityTiers = {
    { name = "Common",    chance = 55, multiplier = 1.0 },
    { name = "Uncommon",  chance = 25, multiplier = 1.3 },
    { name = "Rare",      chance = 13, multiplier = 1.8 },
    { name = "Legendary", chance = 7,  multiplier = 2.5 },
},
levelPayBonus = 0.02,         -- +2% pay per level
levelChanceBonus = 0.5,       -- Better tier chance per level
```

### Clothes (Work Uniform)

```lua
clothes = {
    male = {
        tshirt_1 = 59, tshirt_2 = 1,
        torso_1 = 38, torso_2 = 0,
        pants_1 = 40, pants_2 = 0,
        shoes_1 = 24, shoes_2 = 0,
        -- ... more components
    },
    female = { ... },
}
```

### Preview System

Each job has a multi-step preview with camera angles:

```lua
preview = {
    playerPosition = vector3(x, y, z),
    steps = {
        {
            title = "Welcome to Mining",
            description = { "Step description line 1", "Line 2" },
            camCoord = vector3(x, y, z),
            camTarget = vector3(x, y, z),
            entities = { ... },
        },
        -- ... more steps
    },
}
```

***

## Need Help?

{% hint style="info" %}
Having configuration issues? Join our [Discord server](https://discord.gg/tworst) and open a support ticket.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tworst.com/getting-started-installation/scripts/lite-jobs-pack/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
