# Advanced Options

These optional systems enhance racing depth, competitive balance, and performance on high-load servers. Enable only what your server needs.

**Requires:** resource running · core racing configured

## Anti-Cheat System

Anti-cheat detects violations during races (speed exploits, vehicle health tampering, position manipulation) and applies escalating penalties.

### Enable and Configure Anti-Cheat

**Requires:** access to `config/racing.lua`

1. Open `config/racing.lua`:

```lua
-- File: config/racing.lua
Racing = {
    antiCheat = {
        enabled = true,         -- EDIT THIS
        violationLimit = 3,     -- EDIT THIS: violations before action triggers
        action = 'warn',        -- EDIT THIS: warn | mute | ban
        speedCap = {
            enabled = true,
            limit = 9999        -- EDIT THIS: speed violation threshold
        },
        vehicleHealth = {
            enabled = true,
            threshold = 100     -- EDIT THIS: health must stay above this
        }
    }
}
```

2. Restart the resource.

> **Warning:** Aggressive anti-cheat values create false positives for legitimate racers. Test on staging with known players first.

## GPS Tracker

GPS tracking shows racer positions during active races. This can impact client performance at high player counts, so it's configurable per-server.

### Configure GPS Tracking

**Requires:** access to `config/racing.lua`

1. Open `config/racing.lua`:

```lua
-- File: config/racing.lua
Racing = {
    gpsTracker = {
        enabled = true,           -- EDIT THIS
        updateIntervalMs = 500,   -- EDIT THIS: update frequency
        aheadCount = 5,           -- EDIT THIS: show N players ahead
        behindCount = 5,          -- EDIT THIS: show N players behind
        maxDistance = 1000.0      -- EDIT THIS: tracking range in meters
    }
}
```

2. Restart the resource.

### Validate Performance

1. Run a test race with many connected players.
2. Monitor client frame rate (should not drop).
3. If FPS suffers, reduce `updateIntervalMs` or `maxDistance`.

## Ghost Mode and Pink Slips

Ghost mode disables vehicle collision, letting racers pass through each other. Pink slips add vehicle transfer on loss—risky but popular for high-stakes events.

### Configure Ghost Mode Defaults

**Requires:** access to `config/ui.lua`

1. Open `config/ui.lua`:

```lua
-- File: config/ui.lua
UI = {
    raceSetup = {
        defaultGhostMode = 'Disabled',  -- EDIT THIS: Disabled | Enabled | RespawnOnly
        ghostOptions = {
            allowCustom = true,         -- EDIT THIS: can hosts customize ghost mode?
            pinkSlipEnabled = false      -- EDIT THIS: enable vehicle transfer on loss?
        }
    }
}
```

2. Restart the resource.

### Pink Slip Safety

If `pinkSlipEnabled = true`:

* **Validate:** Test with controlled accounts on staging first.
* **Document:** Clear server rules about when pink slips apply.
* **Monitor:** Watch racer disputes related to pink slip outcomes.

> **Caution:** Pink slips can cause real disputes. Only enable if your community expects it and you have clear rules.

## Racing Line Guidance

Racing lines display optimal track routes to racers in real-time. This helps newer players but creates advantage uncertainty.

### Configure Racing Line

1. In race setup, racing line is controlled by host options.
2. To restrict usage, document your server's policy:
   * **Never:** Hosts cannot enable racing line
   * **Time Trials Only:** Only allowed in solo time trial mode
   * **Always Available:** Racers can use it in any race

> **Note:** Racing line rendering has minimal performance impact when properly configured.

### Validate Racing Line Rendering

1. Start a test race with racing line enabled.
2. Confirm guide lines appear on track.
3. Confirm lines stay visible through checkpoints.
4. If lines flicker, check `track.lua` checkpoint definitions.

## Custom Framework Bridge

If running a non-default framework (not QBCore, Qbox, or ESX), implement a custom bridge so identity, permissions, and money operations work.

### Implement Custom Bridge

1. Open `config/shared.lua` and set:

```lua
Framework = 'custom'
```

2. Create a server adapter in `bridge/server/adapters/your_framework.lua`:

```lua
-- Must export these functions:
exports('getPlayerIdentifier', function(source) ... end)
exports('getMoney', function(source, account) ... end)
exports('removeMoney', function(source, account, amount) ... end)
exports('addMoney', function(source, account, amount) ... end)
exports('hasPermission', function(source, permission) ... end)
```

3. Create a client adapter in `bridge/client/adapters/your_framework.lua`:

```lua
-- Must export these functions:
exports('notifyPlayer', function(message, duration) ... end)
exports('getPlayerData', function() ... end)
```

4. Restart the resource.

### Validate Custom Bridge

1. Join with a test account.
2. Open the profile and confirm identifier loads.
3. Complete a race and confirm money updates.
4. Test admin permissions with a staff account.
5. If any step fails, check server console for bridge call errors.

## Next Steps

* **Troubleshooting:** [Performance and advanced system issues](/vibesez/docs/troubleshooting/index.md)
* **Moderation:** [Handling anti-cheat violations and disputes](/vibesez/docs/admin/moderation.md)


---

# 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://vibesez.gitbook.io/vibesez/docs/advanced/overview.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.
