> For the complete documentation index, see [llms.txt](https://rickys-organization-6.gitbook.io/hwc-documentions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rickys-organization-6.gitbook.io/hwc-documentions/hwc-power-cut.md).

# HWC Power Cut

### 📥 Downloading Your Resource

After purchasing **HWC Power Cut**, you must download it via the **CFX Portal**:

1. Go to: <https://portal.cfx.re/>
2. Log in with the account used to purchase
3. Navigate to:

```
Granted Assets
```

4. Locate:

```
HWC Power Cut
```

5. Click **Download**

***

### 📂 Installing The Resource

#### 1️⃣ Extract The Download

* Extract the `.zip` file
* You will get a folder:

```
HWC_Power_Cut
```

***

#### 2️⃣ Add To Your Server

Place the folder inside your resources directory:

```
resources/[standalone]/HWC_Power_Cut
```

***

### ⚠️ Required Dependencies

Make sure you have:

* ✅ `ox_lib`
* ✅ QBCore **or** ESX
* ✅ Inventory system (qb-inventory / ox\_inventory)

***

### ⚙️ Server Setup

***

#### 1️⃣ Add to server.cfg

```
ensure ox_lib
ensure HWC_Power_Cut
```

***

#### 2️⃣ Add Required Items

***

**🧰 QBCore**

Open:

```
qb-core/shared/items.lua
```

Add:

```
['wire_cutter'] = {
    name = 'wire_cutter',
    label = 'Wire Cutters',
    weight = 500,
    type = 'item',
    image = 'wire_cutter.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'Heavy duty wire cutters'
},

['power_repair_kit'] = {
    name = 'power_repair_kit',
    label = 'Power Repair Kit',
    weight = 2000,
    type = 'item',
    image = 'power_repair_kit.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'Used to repair power stations'
},
```

***

**🧰 ox\_inventory**

Open:

```
ox_inventory/data/items.lua
```

Add:

```
['wire_cutter'] = {
    label = 'Wire Cutters',
    weight = 500,
    stack = true,
    close = true
},

['power_repair_kit'] = {
    label = 'Power Repair Kit',
    weight = 2000,
    stack = true,
    close = true
},
```

***

#### 3️⃣ Add Admin Permissions

Add to your `server.cfg`:

```
add_ace group.admin command.powercut_on allow
add_ace group.admin command.powercut_off allow
add_ace group.admin command.setrepair_time allow
```

***

#### 4️⃣ Restart Your Server

***

### ⚙️ Configuration

All settings are located in:

```
config.lua
```

***

#### 🔧 Key Settings

You can customise:

* Blackout duration
* Repair restrictions (jobs)
* Minigame difficulty
* Power station locations
* Job alerts (police etc.)

***

### 🎮 How Players Use It

***

#### ⚡ Causing a Blackout

Players can trigger a blackout by:

**🔌 Method 1 – Wire Cutting**

* Use **Wire Cutters** at power stations
* Complete the skillcheck
* Disable all stations

***

**💥 Method 2 – Destruction**

* Shoot or explode transformers
* Destroy all required targets

***

👉 Once all stations are disabled:

* City-wide blackout begins
* All lights turn off

***

#### 🔧 Restoring Power

* Use **Power Repair Kit**
* Repair all power stations

👉 Power is restored once all stations are fixed

***

### 👮 Job Restrictions

You can restrict repairs to specific jobs in:

```
Config.RepairRestrictions
```

Example:

* Police
* Electricians
* Mechanics

***

### ⏱️ Auto Restore System

Power can automatically return after a set time:

```
Config.Blackout.autoRestore
```

***

### 🧪 Admin Commands

***

#### ⚡ Power Control

```
/powercut_on
```

➡️ Forces blackout

```
/powercut_off
```

➡️ Restores power

***

#### ⏱️ Set Timer

```
/setrepair_time 60
```

➡️ Sets auto restore to 60 seconds

***

### 🔌 Integration (Advanced)

Other resources can detect power state changes:

* Power OFF event
* Power ON event

👉 Useful for:

* Trains
* Lights
* Security systems

***

### ⚠️ Important Notes

* Resource is **framework compatible (QBCore & ESX)**
* Items MUST be added or it will not work
* Admin permissions are required for commands
* `ox_lib` is required


---

# 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://rickys-organization-6.gitbook.io/hwc-documentions/hwc-power-cut.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.
