# Installation

## Step 1: Download and Prepare Files

### Configurable Settings

For detailed configuration, visit this page: [DOCS.RAINMAD.COM](https://docs.rainmad.com/resources/cargo-ship-heist/configuration)

| Category                 | Config Key                               | Description                                                          |
| ------------------------ | ---------------------------------------- | -------------------------------------------------------------------- |
|                          | `cfg.timecycleInShipZone`                | Custom timecycle name (or false to disable).                         |
| **Heist Rules**          | `cfg.heistInitiatedByDriverOnly`         | Only driver can trigger heist on entering zone.                      |
|                          | `cfg.heistCooldown`                      | Minutes before the next heist can start.                             |
|                          | `cfg.heistFinishDelay`                   | Delay (s) after players leave before cooldown begins.                |
| **Search & Loot**        | `cfg.searchDurations`                    | Durations (s) to search lootboxes, med cabinets, guards, containers. |
|                          | `cfg.lootboxModel` / `cfg.lootboxes`     | Loot-crate object model and spawn locations.                         |
|                          | `cfg.medicineCabinets`                   | Coordinates for medical-supply searches.                             |
| **Security NPCs**        | `cfg.guards.patrol`                      | Array of patrol-route waypoints for foot guards.                     |
|                          | `cfg.skyliftAttachHelpSphere`            | Visual helper marker for helicopter attachment (toggle & opacity).   |
| **Container Mechanics**  | `cfg.containers`                         | Coordinates & rotations for each container target.                   |
|                          | `cfg.weldingSpeed` / `cfg.drillingSpeed` | Base speeds for welding and drilling actions.                        |
|                          | `cfg.disableContainerDrilling`           | Toggle drill method on/off.                                          |
| **Tool Items & Offsets** | `cfg.items`                              | Item names for C4, thermite, weld cutter and drill.                  |
|                          | `cfg.containerDrillOffsets`              | Drill head positions for mini-game.                                  |
|                          | `cfg.containerAttachOffsets`             | Attachment models, positions and rotations for each tool.            |
| **Reward Display**       | `cfg.containerRewardOffsets`             | Crate-spawn offsets by loot type (default, medicine, jewelry, etc.)  |
| **Action Timers**        | `cfg.c4DetonationDuration`               | Seconds until C4 blast.                                              |
|                          | `cfg.thermiteMeltDuration`               | Seconds for thermite to burn through.                                |
| **UI Positioning**       | `cfg.heistInfoPosition`                  | On-screen corner for timer/guard info.                               |

#### **Download the Script from FiveM Keymaster**

* Visit the [FiveM Keymaster](https://keymaster.fivem.net/) site.
* Log in with your account credentials.
* Locate the **Cargo Ship Heist, Cargo Ship Map (If you haven’t purchased the K4MB1-CARGOSHIP map)** and **Tools** scripts in your **Granted Assets** section.
* Download the script files from Keymaster.

**Install and Configure ox\_lib**

* Download the latest version of **ox\_lib** from the [official GitHub page](https://github.com/overextended/ox_lib).
* Extract the `ox_lib` files to your `resources` folder.
* In your `server.cfg`, ensure that `ox_lib` is started before the **Cargo Ship Heist** script by adding the following line:

## Step 2: Add Script to Server Configuration

#### **Edit `server.cfg`**

* Open the `server.cfg` file located in the root directory of your FiveM server.
* Add the following line to ensure the **Cargo Ship Heist** script starts with your server:

```
ensure ox_lib
ensure rm_tools
ensure rm_shipmap # (If you haven’t purchased the K4MB1-CARGOSHIP map)
ensure rm_shipheist
```


---

# 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://docs.rainmad.com/resources/cargo-ship-heist/installation.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.
