> For the complete documentation index, see [llms.txt](https://fantasy-scripts.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://fantasy-scripts.gitbook.io/docs/advanced-government-v2/configuration-file.md).

# Configuration File

```lua
Config = {}

Config.Framework = 'auto' -- 'esx', 'qbcore', 'qbox', 'auto'
Config.Inventory = 'auto' -- 'ox_inventory', 'qb-inventory', 'esx_inventory', 'auto'

Config.Debug = false

-- Localization Settings
-- Available languages: 'en' (English), 'de' (German)
-- You can also set this via convar: set fs_government_locale "de"
Config.DefaultLocale = 'en'

Config.Keybind = 'F6' -- Key to open the government tablet (e.g. 'F6', 'F7', 'F5')

Config.Government = {
    jobs = {
        'police',
    },

    -- Permission list per grade. 'all' grants every permission automatically.
    -- Available permissions:
    --   basic_access        - View dashboard, online staff, announcements, laws, finances, toggle duty
    --   search_players      - Search players, check identity
    --   handcuff            - Handcuff/uncuff players
    --   armory_access       - Access government armory
    --   license_management  - Issue/revoke licenses, manage permits
    --   billing             - Bill nearby players
    --   garage_access       - Access government garage
    --   employee_management - Manage employees, approve/reject/complete appointments
    --   announcements       - Send government announcements
    --   surveillance        - Access surveillance cameras and camera logs
    --   taxation            - View/edit tax settings, view tax revenue & records
    --   elections           - Start/end elections
    --   defcon              - Change DEFCON level
    --   subsidy_management  - Create/manage subsidies
    --   budget_management   - Manage budget allocations and department budgets
    --   business_audit      - Audit, suspend, revoke businesses
    --   financial_reporting - Generate financial reports
    --   seizure             - Seize items/money from players
    --   warrant_issue       - Issue, execute, cancel warrants
    --   all                 - Grants every permission (admin/captain level)
    permissions = {
        [0] = {'basic_access', 'search_players', 'handcuff', 'armory_access'},
        [1] = {'basic_access', 'search_players', 'handcuff', 'armory_access', 'license_management'},
        [2] = {'basic_access', 'search_players', 'handcuff', 'armory_access', 'license_management', 'billing', 'garage_access'},
        [3] = {'basic_access', 'search_players', 'handcuff', 'armory_access', 'license_management', 'billing', 'garage_access', 'employee_management', 'announcements', 'surveillance'},
        [4] = {'all', 'basic_access', 'search_players', 'handcuff', 'armory_access', 'license_management', 'billing', 'garage_access', 'employee_management', 'announcements', 'surveillance', 'taxation', 'elections', 'defcon', 'subsidy_management', 'budget_management', 'business_audit', 'financial_reporting', 'seizure', 'warrant_issue'},
    },

    -- Job rank mappings for professional display
    ranks = {
        police = {
            [0] = 'Recruit',
            [1] = 'Officer',
            [2] = 'Sergeant',
            [3] = 'Lieutenant',
            [4] = 'Captain',
        },
        ambulance = {
            [0] = 'Trainee',
            [1] = 'EMT',
            [2] = 'Paramedic',
            [3] = 'Senior Paramedic',
            [4] = 'Supervisor',
            [5] = 'Lieutenant',
            [6] = 'Captain',
            [7] = 'Chief Medical Officer'
        },
        mechanic = {
            [0] = 'Trainee',
            [1] = 'Mechanic',
            [2] = 'Senior Mechanic',
            [3] = 'Supervisor',
            [4] = 'Manager',
            [5] = 'Owner'
        }
    }
}

-- Departments are now managed through the Budget page in the tablet.
-- Create departments there with Job Code + Label for proper society fund allocation.

Config.Locations = {
    government = {
        coords = vector3(-541.7782, -596.2922, 35.6031),
        blip = {
            sprite = 419,
            color = 0,
            scale = 0.8,
            label_key = 'government_building'
        }
    },
    
    armory = {
        coords = vector3(-543.4741, -591.5427, 35.6030),
        heading = 359.6910
    },
    
    garage = {
        coords = vector3(-495.3517, -602.6877, 33.9006),
        heading = 268.3438,
        vehicles = {
            {model = 'granger', label_key = 'granger', price = 0},
            {model = 'police2', label_key = 'police_suv', price = 0},
            {model = 'fbi', label_key = 'government_sedan', price = 0}
        }
    },
    
    stash = {
        coords = vector3(-542.1180, -599.4560, 35.6031)
    },

    surveillance = {
        cameras = {
            {id = 1, label_key = 'city_hall_entrance', coords = vector3(-544.51, -204.88, 38.22)},
            {id = 2, label_key = 'main_street', coords = vector3(-200.0, -300.0, 30.0)},
            {id = 3, label_key = 'bank_area', coords = vector3(150.0, -1040.0, 29.0)},
            {id = 4, label_key = 'hospital', coords = vector3(300.0, -580.0, 43.0)}
        }
    }
}

Config.Taxation = {
    enabled = true,
    rates = {
        salary = 0.15,          -- 15% tax on salaries
        business = 0.12,        -- 12% tax on business transactions
        vehicle = 0.08,         -- 8% tax on vehicle purchases
        property = 0.10,        -- 10% tax on property purchases
        dmv_fee = 0.05,         -- 5% DMV tax
        parking_fine = 0.02     -- 2% tax on parking fines (custom example)
    },
    intervals = {
        salary = 600000, -- 10 minutes
        business = 3600000 -- 1 hour
    },
    labels = {
        salary = 'Salary Tax',
        business = 'Business Tax',
        vehicle = 'Vehicle Tax',
        property = 'Property Tax',
        dmv_fee = 'DMV Fee Tax',
        parking_fine = 'Parking Fine Tax'
    }
}

Config.Elections = {
    enabled = true,
    duration = 7 * 24 * 60 * 60 * 1000, -- 7 days in milliseconds
    candidate_requirements = {
        min_level = 5,
        min_playtime = 168, -- hours
        registration_fee = 10000
    },
    registration_locations = {
        {
            coords = vector3(-545.1658, -612.5701, 35.6437),
            heading = 2.8538,
            label_key = 'election_registration_desk',
            blip = {
                enabled = true,
                sprite = 408,
                color = 46,
                scale = 0.7,
                label_key = 'election_registration'
            }
        }
    },
    voting_locations = {
        {
            coords = vector3(-510.3576, -621.4949, 35.6032),
            heading = 178.6765,
            label_key = 'voting_booth',
            blip = {
                enabled = true,
                sprite = 408,
                color = 2,
                scale = 0.7,
                label_key = 'voting_booth'
            }
        }
    }
}

Config.DEFCON = {
    levels = {
        [1] = {
            label_key = 'defcon_1_label',
            message_key = 'defcon_msg_1',
            color = {255, 0, 0},
            effects = {
                curfew = true,
                martial_law = true,
                lockdown = true
            }
        },
        [2] = {
            label_key = 'defcon_2_label',
            message_key = 'defcon_msg_2',
            color = {255, 165, 0},
            effects = {
                curfew = true,
                martial_law = false,
                lockdown = false
            }
        },
        [3] = {
            label_key = 'defcon_3_label',
            message_key = 'defcon_msg_3',
            color = {255, 255, 0},
            effects = {
                curfew = false,
                martial_law = false,
                lockdown = false
            }
        },
        [4] = {
            label_key = 'defcon_4_label',
            message_key = 'defcon_msg_4',
            color = {0, 255, 0},
            effects = {
                curfew = false,
                martial_law = false,
                lockdown = false
            }
        },
        [5] = {
            label_key = 'defcon_5_label',
            message_key = 'defcon_msg_5',
            color = {0, 0, 255},
            effects = {
                curfew = false,
                martial_law = false,
                lockdown = false
            }
        },
        [6] = {
            label_key = 'defcon_6_label',
            message_key = 'defcon_msg_6',
            color = {100, 100, 255},
            effects = { curfew = false, martial_law = false, lockdown = false }
        }
    },
    current_level = 5
}

Config.BusinessTypes = {
    'Restaurant',
    'Nightclub',
    'Mechanic',
    'Retail',
    'Logistics',
    'Real Estate',
    'Construction',
    'Medical',
    'Technology',
    'Agriculture',
    'Entertainment',
    'Other',
}

Config.Weapons = {
    {item = 'weapon_pistol', label = 'Pistol', price = 0},
    {item = 'weapon_stungun', label = 'Taser', price = 0},
    {item = 'weapon_nightstick', label = 'Nightstick', price = 0},
    {item = 'weapon_flashlight', label = 'Flashlight', price = 0}
}

Config.Items = {
    {item = 'handcuffs', label = 'Handcuffs', price = 0},
    {item = 'radio', label = 'Radio', price = 0},
    {item = 'armor', label = 'Body Armor', price = 0},
    {item = 'bandage', label = 'Bandage', price = 0}
}
```

```lua
-- =============================================
-- FIELD OPERATIONS CONFIGURATION
-- Customize billing, licenses, and handcuff systems
-- =============================================

Config.FieldOps = {}

-- =============================================
-- BILLING / FINES SYSTEM
-- =============================================
-- Choose which billing resource to use for issuing fines.
-- Options: 'internal', 'esx_billing', 'qb-phone', 'qb-billing', 'okokBilling', 'custom'
-- 'internal' = stores fines in government_fines table only
-- 'auto'     = tries to detect and use whatever billing resource is running
-- 'qb-phone' = QBCore billing via phone_invoices (default for QBCore servers)
Config.FieldOps.BillingSystem = 'auto'

-- If BillingSystem = 'custom', define your own billing function here.
-- This function is called server-side when an officer issues a fine.
-- Parameters: source (officer), targetId (player), amount, reason, officerName, targetName
Config.FieldOps.CustomBillingFunction = function(source, targetId, amount, reason, officerName, targetName)
    -- Example: TriggerEvent('your_billing:sendBill', targetId, amount, reason)
    -- Return true if successful, false if failed
    print('[FS-Gov] Custom billing called: $' .. amount .. ' to player ' .. targetId .. ' for: ' .. reason)
    return true
end

-- Society account name used for billing (esx_billing / qb-billing)
Config.FieldOps.BillingSociety = 'police'

-- Store fines in government_fines database table (in addition to billing resource)
Config.FieldOps.StoreFinesInDatabase = true

-- =============================================
-- LICENSE TYPES
-- =============================================
-- Define which license types officers can issue or revoke.
-- 'name' = internal name (used in database), 'label' = display name in UI
Config.FieldOps.LicenseTypes = {
    { name = 'drive',           label = 'Driving License' },
    { name = 'drive_bike',      label = 'Motorcycle License' },
    { name = 'drive_truck',     label = 'Truck License' },
    { name = 'weapon',          label = 'Weapon Permit' },
    { name = 'pilot',           label = 'Pilot License' },
    { name = 'boat',            label = 'Boat License' },
    { name = 'hunting',         label = 'Hunting License' },
    { name = 'fishing',         label = 'Fishing License' },
    { name = 'business',        label = 'Business Permit' },
}

-- =============================================
-- LICENSE ITEMS (QBCore / ox_inventory)
-- =============================================
-- Map license types to inventory item names.
-- When a license is issued, the item is given to the player.
-- When a license is revoked, the item is removed from the player.
-- Set to false or nil to disable item giving/removing for that license.
Config.FieldOps.LicenseItems = {
    drive         = 'driver_license',
    drive_bike    = 'driver_license',
    drive_truck   = 'driver_license',
    weapon        = 'weaponlicense',
    pilot         = 'pilotlicense',
    boat          = false,
    hunting       = 'huntinglicense',
    fishing       = false,
    business      = false,
}

-- =============================================
-- HANDCUFF SYSTEM
-- =============================================
-- Use built-in handcuff system or integrate with external resources
-- Options: 'internal', 'qb-policejob', 'esx_policejob', 'custom'
Config.FieldOps.HandcuffSystem = 'internal'

-- If HandcuffSystem = 'custom', define your own handcuff functions here.
-- These are called server-side.
Config.FieldOps.CustomHandcuffFunction = function(source, targetId, officerName)
    -- Example: TriggerClientEvent('your_cuff:toggle', targetId)
    print('[FS-Gov] Custom handcuff called on player ' .. targetId .. ' by ' .. officerName)
end

-- Allow officers to handcuff themselves (for testing) - default false
Config.FieldOps.AllowSelfCuff = false

-- Handcuff cooldown in milliseconds (prevents spam)
Config.FieldOps.HandcuffCooldown = 1000

-- =============================================
-- NEARBY PLAYER DETECTION
-- =============================================
-- Maximum distance (in meters) to detect nearby players
Config.FieldOps.NearbyPlayerRange = 50.0

-- Include self in nearby players list
Config.FieldOps.IncludeSelf = true

-- =============================================
-- SEARCH PLAYER
-- =============================================
-- Notification to target when searched
Config.FieldOps.NotifyTargetOnSearch = true

-- Notification to target when identity is checked
Config.FieldOps.NotifyTargetOnIdentityCheck = false

-- Open actual inventory UI when "Open Target Inventory" is clicked
-- Requires ox_inventory or qb-inventory
Config.FieldOps.AllowOpenInventory = true

```


---

# 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://fantasy-scripts.gitbook.io/docs/advanced-government-v2/configuration-file.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.
