Skip to main content

Config Files

The configuration is split between shared/config.lua (framework settings) and shared/webhook.lua (Discord integrations).


shared/config.lua​

Framework Selection​

Config.Framework = 'esx' -- or 'qbcore'

Specifies which framework your server uses. Must match your actual framework.

Allowed values:

  • 'esx' — ESX Framework
  • 'qbcore' — QBCore Framework

Debug Mode​

Config.Debug = false

Enables detailed console logging for troubleshooting. When enabled, you'll see debug messages for:

  • Framework initialization
  • Job changes
  • Tracking start/stop events
  • Network status changes
tip

Enable this during setup to verify the system is working correctly. Disable in production.


Tracked Jobs​

Config.TrackedJobs = {
ambulance = "Ambulance",
police = "Police",
mechanic = "Mechanic",
}

Define which jobs should be tracked. The key is the job name in your database, the value is the display name for Discord messages.

How to add a new job:

  1. Find the exact job name from your database or ESX/QBCore job table
  2. Add it to the table:
Config.TrackedJobs = {
your_job_name = "Display Name in Discord",
}
info

Only jobs listed here will be tracked. If a player changes to a job not in this list, tracking automatically stops.


Webhook Colors​

Config.WebhookColors = {
-- Job colors can be added here for embed customization
}

Reserved for future color customization per job. Currently not active.


Default Color​

Config.DefaultColor = 255

The default embed color for Discord messages (decimal format). Current setting is white (255).

Common color values:

  • 255 — White
  • 16711680 — Red
  • 65280 — Green
  • 255 — Blue
  • 16776960 — Yellow

Report Times​

Config.ReportTimes = {
daily = { hour = 23, minute = 45 },
weekly = { hour = 18, minute = 20 }
}

Set the times when automatic reports are generated and sent to Discord.

  • daily — Sent every day at 23:45 (11:45 PM)
  • weekly — Sent every week at 18:20 (6:20 PM, typically Friday)

Time format: 24-hour (0-23 hours, 0-59 minutes)

Example — Daily report at noon, weekly on Monday at 9 AM:

Config.ReportTimes = {
daily = { hour = 12, minute = 0 },
weekly = { hour = 9, minute = 0 }
}
info

Reports include summaries of all tracked work time for the configured period.


Language​

Config.Locale = "sl"

Sets the language for webhook messages and console output.

Supported languages:

  • "en" — English
  • "sl" — Slovenian

Translations are loaded from the locales/ folder.


Discord Avatar​

Config.AvatarURL = "https://r2.fivemanage.com/wyTeYcIJQmPSbGaf6THxa/unibit.webp"

The avatar image URL displayed in Discord embeds. Replace with your own image URL.

Requirements:

  • Must be a direct image URL (ends in .png, .jpg, .webp, etc.)
  • Must be publicly accessible
  • Recommended size: 256×256 pixels
tip

Use a CDN like Imgur, Cloudinary, or your own server to host the image.


Minimum Tracking Time​

Config.MinTrackingTime = 5

The minimum work duration (in seconds) before logging is sent to Discord. Prevents spam from very short job changes.

Default: 5 seconds (sessions shorter than this are not reported)


Webhook Username​

Config.WebhookUsername = "Vice-PlayerTime"

The name displayed on Discord webhook messages. Change this to your branding.

Example output:

Posted by: Vice-PlayerTime

shared/webhook.lua​

Contains Discord webhook URLs for job notifications.

Join/Leave Webhooks​

Webhooks.join = {
ambulance = "https://discord.com/api/webhooks/...",
police = "https://discord.com/api/webhooks/...",
-- ...
}

Sent when a player starts or stops working for a job.

Daily/Weekly Report Webhooks​

Webhooks.daily = {
ambulance = "https://discord.com/api/webhooks/...",
police = "https://discord.com/api/webhooks/...",
-- ...
}

Sent at the times configured in Config.ReportTimes.


How to Create Discord Webhooks​

  1. Open your Discord server and go to Server Settings → Integrations
  2. Click Create Webhook
  3. Name it (e.g., "Job Reports") and select the target channel
  4. Copy the webhook URL
  5. Paste it into shared/webhook.lua
warning

Webhook URLs contain tokens. Never share them or commit them to public repositories!

tip

Use separate webhooks for different jobs and reports for better organization in Discord.