> For the complete documentation index, see [llms.txt](https://gscripts.gitbook.io/gscripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gscripts.gitbook.io/gscripts-docs/gs-citations/configuration.md). Agents can also search and read this documentation through its [MCP server](https://gscripts.gitbook.io/gscripts-docs/~gitbook/mcp).

# Configuration

This guide matches the default config.lua shipped in GS Citations 0.6.7. Edit config.lua; ordinary setup does not require changes to protected client/server Lua. Replace the existing setting rather than adding another copy at the end. Keep quoted strings, commas and braces intact. Restart gs\_citations after changing its config.

#### Quick setup

1. Select your framework and inventory, and start them before gs\_citations.
2. Register the three book items and citation paper from Inventory setup.
3. Match agency jobs and grades to your server.
4. Position at least one station desk.
5. Choose RP-only, desk or automatic payments.
6. Set your printed timezone and optional RP year.

The release defaults to automatic integration detection, desk payments, a 30-day deadline, text interaction, UK printed time and /e notepad. Your test-server config may use different values.

#### 1. Framework and inventory

| Setting            | Default       | Purpose / accepted values                                                                                       |
| ------------------ | ------------- | --------------------------------------------------------------------------------------------------------------- |
| Config.Framework   | 'auto'        | 'auto', 'standalone', 'esx', 'qb'. Auto prefers running ESX, then QBCore.                                       |
| Config.Inventory   | 'auto'        | 'auto', 'none', 'ox\_inventory', 'qb-inventory'. QB inventory requires QBCore. 'none' uses the document wallet. |
| Config.Items.book  | 'citbook\_pd' | Default book selected by the book command.                                                                      |
| Config.Items.paper | 'citation'    | Shared item used for all issued papers.                                                                         |
| Config.RequireBook | true          | Require a physical book even when an officer opens it by command, in inventory mode.                            |

Examples (choose one):

```lua
-- ESX with ox_inventory
Config.Framework = 'esx'
Config.Inventory = 'ox_inventory'

-- QBCore with qb-inventory
-- Config.Framework = 'qb'
-- Config.Inventory = 'qb-inventory'

-- Standalone document wallet
-- Config.Framework = 'standalone'
-- Config.Inventory = 'none'
```

Standalone does not magically add cash/bank accounts or a police job. Use ACE permissions for officers and a custom money adapter for real payments, or select RP-only mode.

#### 2. Agency books

The item key must match its inventory definition. All agencies issue the same citation paper item. Each book supplies its own printed department and allowed jobs. These are the release profiles:

```lua
Config.Items = { book = 'citbook_pd', paper = 'citation' }
Config.CitationBooks = {
    citbook_pd = {
        department = 'Los Santos Police Department',
        jobs = { police = 0 }
    },
    citbook_sd = {
        department = "Los Santos County Sheriff's Department",
        jobs = { sheriff = 0 }
    },
    citbook_sahp = {
        department = 'San Andreas Highway Patrol',
        jobs = { highway = 0 }
    }
}
```

The number after each job is its minimum grade. Config.Jobs also controls overall officer access; include your agency jobs there. A police character is not automatically allowed to use sheriff/highway books. For testing only, add police = 0 to the relevant jobs table. ACE officer access can bypass agency restrictions.

Config.Department is the fallback department when the default book has no profile. A listed profile takes precedence. Drafts are kept separately per character and book.

To add a new agency: register its inventory book, add its profile and add its job to Config.Jobs. For example, add this entry inside the existing Config.CitationBooks table, then register citbook\_custom in your inventory:

```lua
citbook_custom = {
    department = 'Your Department',
    jobs = { your_police_job = 0 }
},
```

#### 3. Payments and overdue rules

| Setting                  | Default                      | Meaning                                                                                                                                        |
| ------------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Config.PaymentMode       | 'desk'                       | 'rp': no payable debt. 'desk': pay at a configured station. 'automatic': attempt a bank charge when issued; unsuccessful debits remain unpaid. |
| Config.MaximumFine       | 100000                       | Maximum allowed whole-number fine. Zero means a warning.                                                                                       |
| Config.MaximumViolations | 3                            | Maximum reasons, from one to three.                                                                                                            |
| Config.DueDays           | 30                           | Days before a newly issued unpaid fine becomes overdue.                                                                                        |
| Config.PaymentAccounts   | { cash = true, bank = true } | Enable/disable the desk payment methods.                                                                                                       |
| Config.AllowNegativeBank | false                        | Permit automatic charging below zero only if the selected money adapter supports it. Manual payments still need enough funds.                  |
| Config.RemovePaidPaper   | true                         | Remove copies of the paid reference from the payer's inventory. Does not remove other citations.                                               |

```lua
Config.PaymentMode = 'desk'
Config.DueDays = 14
Config.PaymentAccounts = { cash = true, bank = true }
```

After fourteen real days, an unpaid fine appears under BOTH All unpaid and Overdue only. There is no automatic late fee. Changing DueDays affects new fines; existing fines keep their saved due date. Printed dates and RP years do not change this calculation.

Paid/deleted records leave the active register. Dropping an inventory paper does not cancel its debt. Permanent police history belongs to your external MDT.

#### 4. Printed timezone and RP year

```lua
Config.DateTime = {
    rpYear = false,
    timeZone = 'Europe/London',
    locale = 'en-GB',
    hour12 = false,
    showTime = true,
    allowEdit = true
}
```

| Option    | What to change                                                                                                                   |
| --------- | -------------------------------------------------------------------------------------------------------------------------------- |
| rpYear    | false uses the real year; 1995 prints a 1995 RP year on papers and desk views.                                                   |
| timeZone  | IANA region name, such as 'Europe/London', 'Europe/Tallinn' or 'America/Los\_Angeles'. Region zones handle daylight saving time. |
| locale    | 'en-GB' for UK-style date order; 'en-US' for US-style order.                                                                     |
| hour12    | false for 24-hour time; true for AM/PM.                                                                                          |
| showTime  | Whether the issue time is printed alongside the date.                                                                            |
| allowEdit | Whether officers may manually type the printed date/time.                                                                        |

For a 1995 server in Estonia, change rpYear to 1995 and timeZone to 'Europe/Tallinn'. For UK time keep 'Europe/London': it is GMT in winter and BST in summer. Do not enter GMT+2 as a timezone string in this release. Invalid timezone names fall back to UTC. Real issue timestamps still control overdue status.

#### 5. Officer permissions

```lua
Config.Jobs = { police = 0, sheriff = 0, highway = 0 }
Config.RequireDuty = true
Config.VoidGrade = 3
Config.DeleteGrades = { police = 3, sheriff = 3 }
```

Jobs controls issuing, searching and reprinting. RequireDuty checks duty status when the framework provides it. VoidGrade is the fallback deletion grade; DeleteGrades overrides it per job. Civilian players may use desks to view/pay their own fines without an officer job.

Standalone/admin permissions are named by Config.Ace. Optional server.cfg grants:

```cfg
add_ace group.admin gs_citations.officer allow
add_ace group.admin gs_citations.void allow
```

The officer permission grants officer access; void grants deletion permission. Do not grant either to all players. Existing admin ACE access can explain why a low-grade test character can use restricted actions.

#### 6. Multiple station desks

The first entry below is the release default. The second is an illustrative location: replace its coordinates with your own MLO desk position.

```lua
Config.Desks = {
    {
        name = 'Mission Row Records',
        coords = { x = 441.2, y = -980.55, z = 30.7 },
        bucket = 0
    },
    {
        name = 'Second Station Records',
        coords = { x = 1853.0, y = 3689.0, z = 34.3 },
        bucket = 0
    }
}
Config.DeskInteraction = 'text'
Config.DeskPromptDistance = 5.0
Config.DeskUseDistance = 1.2
```

coords is the interaction point; bucket is the intended routing bucket. Add/remove table entries for more desks. DeskPromptDistance controls prompt visibility; DeskUseDistance controls opening range. The server validates desk proximity independently.

For third-eye interaction set Config.DeskInteraction = 'ox\_target'. The target is optional and falls back to text if unavailable.

| Group             | Options                                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Config.DeskTarget | resource: target resource name; radius: sphere radius in metres; icon: Font Awesome icon; debug: show zones while placing desks. |
| Config.DeskPrompt | offset: x/y/z added to desk coordinates for prompt/target centre; scale: text size; font: GTA font index; color: r/g/b/a values. |

Move the actual desk coordinates to fix use range. Increasing target radius only enlarges its zone; it does not bypass server distance checks. Disable debug after placement.

#### 7. Keys and commands

| Config.Keys option | Default  | Action                                                   |
| ------------------ | -------- | -------------------------------------------------------- |
| desk               | 'E'      | Open a nearby desk.                                      |
| close              | 'ESCAPE' | Put paper away completely. ESC remains available.        |
| refocus            | 'LMENU'  | Left ALT raises/lowers a paper. Does not lower the desk. |

Players can rebind mapped actions in FiveM settings. Existing saved key bindings may override newly changed defaults. Right-click lowers a raised paper; it does not raise it. Lowered paper does not retain UI input focus.

Config.Commands uses names without a slash: book = citationbook, desk = citationdesk, papers = citationpapers, close = citationputaway, refocus = citationtoggle, resolve = citationresolve. Book/desk commands still check permissions, items and proximity. resolve is server-console-only payment reconciliation; staff must check the real transaction before resolving anything.

#### 8. Notebook animation

Animation starts only for a raised citation book; closing or lowering it stops our notebook. Reading an issued paper never starts this animation.

Release default:

```lua
Config.Animation = {
    enabled = true,
    provider = 'command',
    cancelCommand = 'emotecancel',
    command = 'e',
    resource = 'rpemotes',
    emote = 'notepad',
    emoteType = 'PropEmotes',
    forceCancel = true
}
```

For another command-based emote menu, set resource = '' and use that menu's own command, emote and cancellation command. Example /e notepad with /emotecancel:

```lua
Config.Animation.provider = 'command'
Config.Animation.resource = ''
Config.Animation.command = 'e'
Config.Animation.emote = 'notepad'
Config.Animation.cancelCommand = 'emotecancel'
```

| Provider  | Meaning                                                                                       |
| --------- | --------------------------------------------------------------------------------------------- |
| 'command' | Run the configured emote command; use the RPEmotes integration when configured and available. |
| 'auto'    | Compatible RPEmotes export integration.                                                       |
| 'native'  | Built-in GTA animation/props from Config.NativeAnimation.                                     |
| 'none'    | Disable animation; enabled = false also disables it.                                          |

command and cancelCommand have no leading slash. emoteType is the RPEmotes category; forceCancel controls cancelling our own notebook. Generic command mode cannot identify unrelated animations as reliably as the RPEmotes integration. NativeAnimation contains dict, clip, flags, blendIn/blendOut and each prop's model, bone, position and rotation; it is ignored by the default command provider.

#### 9. Appearance and text

Config.UI sets the paper/desk appearance. Keep contrast between paper and ink.

| Options                | Release defaults / purpose                                                                        |
| ---------------------- | ------------------------------------------------------------------------------------------------- |
| side, edge, top        | 'right', '3vw', '5vh': initial paper location. Player dragging may save another position locally. |
| width                  | '460px': paper width, capped to screen size.                                                      |
| paper, ink             | '#8e9b77', '#171d16': paper and text colours.                                                     |
| writingFont, inputSize | 'Kalam, cursive', '20px': filled field font and size; Kalam is bundled.                           |
| motionMs               | 180: opening/lowering motion duration in milliseconds.                                            |
| standbyPeek            | 120: visible pixels of the lowered paper.                                                         |
| notificationMs         | 5000: status message duration in milliseconds.                                                    |
| deskWidth              | '620px': centered desk width.                                                                     |
| deskPaper, deskInk     | '#f5f4ef', '#161616': desk background/text.                                                       |
| deskInputSize          | '18px': desk field text size.                                                                     |

Example:

```lua
Config.UI.width = '480px'
Config.UI.inputSize = '22px'
Config.UI.paper = '#8e9b77'
Config.UI.ink = '#171d16'
Config.UI.deskWidth = '660px'
```

Config.Text groups every player-facing English label/status/message. Edit these strings to translate the UI; keep their keys. Changing a displayed title does not rename an inventory item or command.

#### 10. Advanced reference

Most servers can keep these defaults. Shared config is sent to clients: never place secrets in it.

| Setting/group                  | Purpose                                                                                                                                                                                 |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Config.Resources               | Integration resource names: esx, qb, ox, qbInventory. Change only for renamed compatible resources.                                                                                     |
| Config.TransferDistance        | Maximum nearby transfer range for the built-in document wallet; default 3.0 metres.                                                                                                     |
| Config.ServerDistanceTolerance | Network-position allowance for server proximity checks; default 0.7 metres.                                                                                                             |
| Config.IdleCheckMs             | Desk proximity polling away from desks; default 1000 milliseconds.                                                                                                                      |
| Config.BlockedControls         | Controls blocked while UI cursor input is active; camera/attack/aim/weapon wheel/melee.                                                                                                 |
| Config.RevealUnmatchedNames    | false keeps unknown-name papers looking normal for RP; it does not assign a debt.                                                                                                       |
| Config.NameLookup              | Optional oxmysql offline ESX/QB character lookup. useDatabase enables it; database names the resource; esxQuery/qbQuery must match your actual schema. No mandatory SQL citation table. |
| Config.Custom                  | Optional server adapter functions: identity, officer, debit and resolveName. nil uses built-in behavior.                                                                                |

Issuing requires an exact full character-name match after case/space normalization; officer desk searches accept partial names. Unknown or ambiguous names create a paper without a payable owner. Without database lookup, only online/previously seen characters can be resolved by the built-in registry.

Custom adapter contracts: identity(source) returns { key, name }; officer(source) returns allowed, mayVoid; debit(source, account, amount, allowNegative, citationId) returns true only after a real debit; resolveName(fullName) returns { key, name, source } or nil. Use matching stable character keys; do not report successful payments before they occur.

Config.Limits groups maximum UTF-8 text lengths (name/location/badge/vehicle/plate/reason/notes/search), list page size, requestMs/issueMs/draftMs/printMs rate limits, and client timing: requestTimeoutMs, draftDebounceMs, searchDebounceMs, keyDebounceMs, pauseGuardMs, animationLoadMs and animationCheckMs. Time values are milliseconds. Shortening these does not guarantee better performance and can create duplicate requests or missed saves.

Config.AdvancedUI provides line, accent, buttonInk, focusFill, hoverFill and shadow for paper styling; currency changes the displayed amount prefix only. font, labelSize, writingWeight, buttonSize and hintSize control typography. noticeBottom/noticeSize position and size status messages. paperSelection/deskSelection colour selected text. deskMaxHeight, deskLine, deskAccent, deskButtonInk, deskWritingFont, deskFocusFill and deskHoverFill control desk presentation. Common Config.UI values take precedence over copied advanced defaults.

#### Test after setup

Open each agency book with its intended job, issue a warning and a payable fine, reopen a saved draft, pay one fine at the desk, and verify only that reference disappears. Check civilian desk access, officer search and deletion grades. Reconnect to verify persistence. Test your chosen emote menu and interaction method before live use.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gscripts.gitbook.io/gscripts-docs/gs-citations/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
