> For the complete documentation index, see [llms.txt](https://prime-scripts-1.gitbook.io/pr-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prime-scripts-1.gitbook.io/pr-scripts-docs/docs/quickstart-1/configuration.md).

# ⚙️Configuration

```etlua
Config = Config or {}

Config.Framework = 'esx' --  'esx', 'qb' o 'qbx' 
Config.Debug = false -- [BOOLEAN] 
Config.CreateRacesAdminOnly = false -- [BOOLEAN]
Config.IsRaceSetupAllowed = true -- [BOOLEAN]
Config.TPtoRaces = false -- [BOOLEAN]
Config.UseBucketSystem = true -- [BOOLEAN] Bucket System // Fixes conflicts for same Bucket on rewards scene
Config.NoCollisionDuringRace = true -- [BOOLEAN] Avoid collisions between player vehicles during the race
Config.BucketSystem = {
    DefaultBucket = '0', -- [INT]
    RacingBucket = math.random(1, 99999) -- [INT]
}
Config.Dispatch = { -- DISPATCH WILL ONLY WORK IF Config.UseBucketSystem = false
    Enabled = false, -- [BOOLEAN] Enable/disable police dispatch alerts
    Dispatch = 'origen_police' -- [STRING] // 'origen_police', 'cd_dispatch' // You can add your own to custom/dispatch.lua
}
Config.Logs = { -- Visit custom/sv_webhooks.lua to set webhooks
    enabled = true -- [BOOLEAN] 
}

-- Experience System Configuration
Config.ExperienceSystem = {
    UseXPSystem = true, -- [BOOLEAN] Enable/Disable XP rewards after races
    BaseXP = 100 -- [INT] Base XP amount for race completion
}

Config.RacingTabletItemName = 'racing_tablet' -- [STRING] Racing Tablet Item Name

Config.CheckPointMetric = 'MT' -- MT (metros), YD (yardas), MI (millas)
Config.RaceJoinDistance = 50.0 -- Minimum distance to automatically join when using waypoint (in meters)

-- Command config to open UI without item
Config.RacingCommand = {
    Command = "racing",
    Enabled = true,
    RequireVehicle = false,
    RequireVehicleMessage = 'You need to be in your vehicle to use the racing menu.'
}

-- Commands Config
Config.Commands = {
    RacingAdmin = "racingadmin",
    CrewInvite = "crewinvite",
    CrewKick = "crewkick",
    CrewLeave = "crewleave",
    CancelRace = "cancelrace",
    LeaveRace = "leaverace",
    ClearCache = "clearcache",
    CheckDimension = "checkdimension"
}

-- Groups with access to Tab Admin / Admin Panel ONLY ESX
Config.Groups = {
    'admin',
    'god',
    'helper'
}

-- Admin Panel Permission Settings (QB/QBX)
-- If you use QB/QBX, you can configure here which jobs or permissions have access
Config.AdminPanel = {
    -- Jobs that have access to the admin panel (QB/QBX)
    AllowedJobs = {
        'police',
        'YOUR_JOB_NAME'
    },
    -- Minimum grade required for jobs (0 = any grade)
    MinGrade = 0,
    -- Required permissions (if you use QB permission system)
    RequiredPermissions = {
        'admin',
        'god'
    }
}



-- Performance optimization settings
Config.Performance = {
    -- Checkpoints optimization
    CheckpointRenderDistance = 500.0, -- Checkpoint rendering distance (meters)
    CheckpointRefreshRate = 100, -- Update checkpoints every X ms

    -- Cache System
    CachePlayerStats = true, -- Cache player statistics
    CacheLeaderboard = true, -- Cache leaderboard
    CacheTime = 300000, --  Cache timecycle (5 minutes on ms)
    
    -- UI optimization
    LazyLoadImages = true, -- Upload images on demand
    PreloadSounds = true, -- Preload sounds at startup
    ReducedParticles = false, -- Reduce particle effects (for low-performance servers)
    
    -- Thread optimization
    PositionUpdateRate = 500, -- Update positions every X ms
    UIUpdateRate = 100, -- Update UI every X ms (during race)
    
    -- Auto Cleanup
    AutoCleanupOldRaces = true, -- Clean up old races automatically
    CleanupInterval = 3600000, -- Clean up every hour (in ms)
    KeepRaceHistory = 24, -- Keep race history for X hours
}

```


---

# 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 dynamically by asking a question.

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

```
GET https://prime-scripts-1.gitbook.io/pr-scripts-docs/docs/quickstart-1/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.
