> For the complete documentation index, see [llms.txt](https://docs.lostdev.store/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lostdev.store/territories/getting-started.md).

# Getting Started

**ld\_territories** is a standalone FiveM resource that implements a **gang/faction territory war** system: capturable zones on the map, real-time capture progress, contested states, post-capture cooldown, rewards, attack alerts, and a **tactical tablet** with a leaderboard, statistics, activity history, and a full admin panel for managing territories at runtime.

## Key features

* **Proximity-based territory capture** — a player enters the zone and capture starts automatically if they meet the requirements (allowed gang/job, no active cooldown, etc).
* **Capture speed scaling** based on the number of simultaneous attackers (`Config.PlayerScaling`).
* **Contested states** when two or more factions are inside the same zone at the same time — progress freezes until only one faction remains.
* **Configurable post-capture cooldown**, during which the territory is immune to new attacks.
* **Rewards** (money, items, XP, or a custom callback) for the owning faction.
* **Map blips** with per-faction colors, a visual radius circle of the zone, a color cycle for contested territories, and a blacklist by gang/job.
* **"Under attack" alerts** — the owning faction gets a banner, sound, and a flashing blip, wherever they are on the map.
* **Tactical tablet (NUI)** — a full React HUD with Overview, Territories, Factions, My Faction, Statistics, History, and Admin tabs.
* **Admin Panel** — create/delete zones, force owner, progress, cooldown, and reset, all with an audit log.
* **Multi-framework** — supports QBX (`qbx_core`), QBCore (`qb-core`), and ESX (`es_extended`), with auto-detection or standalone/custom mode.
* **Localization** — PT/EN included, easy to extend.

## Dependencies

<table><thead><tr><th width="244">Resource</th><th>Required</th><th>Purpose</th></tr></thead><tbody><tr><td><a href="https://github.com/overextended/ox_lib"><code>ox_lib</code></a></td><td>Yes</td><td>Zones (<code>AddZone</code>), notifications</td></tr><tr><td><a href="https://github.com/overextended/oxmysql"><code>oxmysql</code></a></td><td>Yes</td><td>MySQL persistence</td></tr><tr><td><code>qbx_core</code> / <code>qb-core</code> / <code>es_extended</code></td><td>One of them (or none, in standalone mode)</td><td>Player identity (gang/job), money, items</td></tr></tbody></table>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.lostdev.store/territories/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
