> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r-scripts.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Step-by-step guide to install R_FFA on your FiveM server

## Prerequisites

<Steps>
  <Step title="Required Dependencies">
    * **ox\_lib** - UI and utilities
    * **ox\_inventory** - Weapon management
    * **oxmysql** - Database operations
    * **Framework** - ESX, QBCore, or QBX
  </Step>
</Steps>

## Installation Steps

<Steps>
  <Step title="Download & Extract">
    Download R\_FFA and place it in your `resources` folder as `r_ffa`
  </Step>

  <Step title="Database Setup">
    Import the SQL file:

    ```sql theme={null}
    CREATE TABLE IF NOT EXISTS `r_ffa` (
        `citizen_id` CHAR(50) DEFAULT NULL,
        `username` VARCHAR(100) DEFAULT 'Unknown',
        `kills` VARCHAR(50) NOT NULL DEFAULT '0',
        `deaths` BIGINT(20) NOT NULL DEFAULT '0',
        PRIMARY KEY (`citizen_id`) USING BTREE
    ) ENGINE=InnoDB COLLATE='utf8mb4_general_ci';
    ```

    Or enable auto-insert:

    ```lua theme={null}
    R.EnableAutoinsert = true
    ```
  </Step>

  <Step title="Configure Framework">
    Edit `config.lua`:

    ```lua theme={null}
    R.Framework = "qbx" -- ESX, qbcore, or qbx
    R.newESX = true
    R.CoreName = "es_extended"
    R.AmbulanceJob = "qbx" -- esx, wasabi, qb, or qbx
    ```
  </Step>

  <Step title="Configure Target (Optional)">
    ```lua theme={null}
    R.UseTarget = false -- Set true if using target
    R.Target = "ox_target" -- or "qb-target"
    ```
  </Step>

  <Step title="Add to server.cfg">
    ```cfg theme={null}
    ensure ox_lib
    ensure ox_inventory
    ensure oxmysql
    ensure es_extended
    ensure r_ffa
    ```
  </Step>

  <Step title="Start Server">
    Perform a full server restart
  </Step>
</Steps>

## Verify Installation

1. Find the FFA join location (default: `-257.2, -972.6, 31.2`)
2. Join an arena and test functionality

## Commands

| Command       | Description                      |
| ------------- | -------------------------------- |
| `/ffaweapons` | Manage weapons                   |
| `/ffacomp`    | Manage weapon components         |
| `/ffaleave`   | Leave arena                      |
| `/ffaadmin`   | Admin menu (requires permission) |

<Card title="Next: Configuration" icon="gear" href="/r_ffa/configuration">
  Configure your FFA system
</Card>
