# Installation

***

### Dependancies

```
ox_lib (required)
oxmysql (required)
screenshot-basic (required)
ox_inventory / tgiann-inventory (required)
qb-target / ox_target (required)
lb-phone / lb-tablet (optional)
fivemanage / fivemerr / discord webhook (optional for photo/video functionality)
```

> **Inventories:** All inventory functions are editable. Any inventory system that supports item metadata functionality can be compatible. ox\_inventory & tgiann-inventory work out the box.\
> \
> **IMPORTANT: QB-INVENTORY IS NOT COMPATIBLE**

***

### 1. Add to server resources

Drop the `fiveous_drones` folder into your server's `resources` directory.

Add to `server.cfg`:

```
ensure fiveous_drones
```

> **Important:** `fiveous_drones` must start **after** all dependencies.
>
> **Inventory:** ox\_inventory or tgiann-inventory is **required**. qb-inventory is not supported because it does not reliably persist item metadata (drone serials, battery charge, etc.).

***

### 2. Add Items

You will find the tgiann and ox item configuration [HERE](https://docs.fiveous.net/~/revisions/47lNAT5RfBJwp7dsVjgA/scripts/fiveous_drones/guides/inventory-setup)

**ox\_inventory:** `ox_inventory/data/items.lua`

**tgiann-inventory:** `tgiann-inventory/items/items.lua`

***

### 3. Add Item Images

Place your item images in your inventory's image folder:

**ox\_inventory:** `ox_inventory/web/images/`

**tgiann-inventory:** `inventory_images/images/`

Files needed:

* `fiveous_drone.png`
* `fiveous_controller.png`
* `fiveous_battery.png`
* `fiveous_drone_parts.png`

***

### 4. How It Works

<table><thead><tr><th width="105">Step</th><th>What Happens</th></tr></thead><tbody><tr><td>1</td><td>Player uses the <strong>Drone</strong> item from inventory</td></tr><tr><td>2</td><td>Drone prop (<code>ch_prop_casino_drone_02a</code>) spawns on the ground in front of them</td></tr><tr><td>3</td><td>Player gets a notification: <em>"Use your controller or walk up to the drone to connect"</em></td></tr><tr><td>4</td><td>Player either uses the <strong>Controller</strong> item OR walks up and uses <strong>qb-target</strong> on the drone</td></tr><tr><td>5</td><td>Drone "spins up" for 2 seconds, then takes flight</td></tr><tr><td>6</td><td>Camera switches to drone POV — player ped stays behind doing a controller animation</td></tr><tr><td>7</td><td><strong>If drone hits a wall/ground/object or is shot down</strong> → it crashes, a broken drone prop spawns at crash site</td></tr><tr><td>8</td><td>Anyone can walk up to the broken prop → <strong>qb-target</strong> prompt: "Salvage Crashed Drone" → receives <code>fiveous_drone_parts</code> with serial number, owner ID, cause of crash, and flight stats</td></tr><tr><td>9</td><td><strong>If player presses L</strong> → drone lands safely, player can walk to it</td></tr><tr><td>10</td><td>Player walks up to landed drone → <strong>qb-target</strong> prompt: "Pick Up Drone" → item returned with all stats</td></tr></tbody></table>

#### Serial Numbers & Stats

* Every drone gets a unique serial number (e.g. `FVD-A3B7C2`) on first use
* The owner's citizen ID is stamped on the drone metadata
* Flight stats track: total flights, distance flown (metres), and battery swap cycles
* All metadata persists through the item — pick up, put down, trade, crash
* When a drone crashes, the parts carry the same serial + stats + cause of death

***

### 5. Controls (During Flight)

<table><thead><tr><th width="162">Key</th><th>Action</th></tr></thead><tbody><tr><td><strong>WASD</strong></td><td>Fly forward/back/left/right</td></tr><tr><td><strong>Mouse</strong></td><td>Look / aim</td></tr><tr><td><strong>Space</strong></td><td>Fly up</td></tr><tr><td><strong>X</strong></td><td>Fly down</td></tr><tr><td><strong>Shift</strong></td><td>Fast speed</td></tr><tr><td><strong>Ctrl</strong></td><td>Slow/precise speed</td></tr><tr><td><strong>Scroll</strong></td><td>Adjust speed</td></tr><tr><td><strong>Ctrl + Scroll</strong></td><td>Adjust FOV (zoom)</td></tr><tr><td><strong>G</strong></td><td>Cycle post-FX filters</td></tr><tr><td><strong>P</strong></td><td>Capture photo (requires Fivemanage)</td></tr><tr><td><strong>O</strong></td><td>Start / stop recording (requires Fivemanage)</td></tr><tr><td><strong>L</strong></td><td>Land the drone</td></tr><tr><td><strong>Z</strong></td><td>Toggle HUD</td></tr></tbody></table>

***

### 6. Configuration

Everything is in `config/config.lua` & `config/server_config.lua`

***

### **7. Drone Battery Setup**

The battery system is **optional**. Set `Config.Battery.enabled = false` in your config to disable it entirely, drones will have infinite flight time.

When enabled, both `fiveous_drone` and `fiveous_battery` items store their power level in item metadata under the `charge` field (0–100). Drones & batteries are at full charge by default (`Config.Battery.defaultCharge`). Players can swap batteries on a landed drone through the target interaction, which pulls the current battery out into their inventory (retaining its remaining charge) and loads the new one.

This script **does not** include a battery charging mechanic, it only drains and swaps them. You'll want to hook into your server's existing crafting, housing, or shop system to give players a way to recharge or buy fresh batteries. All you need to do is set the `charge` metadata on the `fiveous_battery` item:

```lua
-- Example: setting all batteries in the player's inventory to 100% charged
local batteries = exports.ox_inventory:Search(source, 'slots', 'fiveous_battery')

if batteries then
    for _, item in ipairs(batteries) do
        exports.ox_inventory:SetMetadata(source, item.slot, { charge = 100 })
    end
end
```

#### Here is our recommended charging system we've developed to charge the drone, drone batteries. It also offers a powerbank item, charging stations & a car charger item for LB-Phone & fiveous\_drones.

#### Recommended Charging Script: [fiveous\_charger](https://docs.fiveous.net/scripts/fiveous_charger)
