bazq blackout

A highly optimized, feature-rich blackout system for FiveM. Turn off the city lights and force players to rely on generators and safezones to survive the darkness.

Features

Global Blackout Management

Toggle the entire city's artificial lights with a single command.

  • Optimized Performance: Idle usage 0.00ms (unified scanner system, event-based toggling).

Static Safezones

Define safe areas using Sphere or PolyZone shapes. Lights remain ON in these zones regardless of the global blackout state.

Dynamic Generators

Functionality:

  • Toggle On/Off: Turn generators off manually to save fuel.

  • Maintenance: Generators lose durability over time. Repair them to keep them running.

  • Fuel System: Real-time consumption. Requires refueling (configurable items).

  • Synergy Bonus: Stacking generators within range increases their light radius.

Interaction:

  • Drag & Drop: Move generators manually using Alt-Eye -> Drag.

  • Towing: Tow generators with specific pickup trucks (model-based restrictions).

Persistence:

  • Location, Fuel, Durability, and On/Off state are saved automatically to JSON.

Inventory Support

Automatically detects and supports:

  • ox_inventory

  • qb-inventory (and variants)

  • esx_inventory (default)

  • core_inventory (C8Re)

Dependencies

circle-info

Required resources:

  • ox_lib

  • ox_target

Installation

1

Place files

Download the resource and place it in your resources folder.

2

Enable resource

Add the following to your server.cfg:

3

Configure

Edit config.lua to your liking.

Configuration

The config.lua contains detailed settings:

  • Generators: Define models, base radius, drag/tow offsets.

  • Fuel: Consumption rates, refuel items (water by default).

  • Maintenance: Enable/Disable durability, set repair items (repairkit), decay rates.

  • Towing: Allowed vehicles (e.g., bison, sadler), items required.

  • Safezones: List of predefined areas that are always lit.

Commands

  • /blackout - Toggles the blackout state.

circle-exclamation

Usage Guide

For Players

1

Find a Generator

Scavenge or buy a portable generator.

2

Setup

  • Drag it to your desired location (Alt-Eye -> Drag).

  • If you have a truck, you can tow it (Alt-Eye -> Tow).

3

Operation

  • Refuel: Ensure it has fuel/water.

  • Repair: Check durability. If broken (0%), it won't start. Use a repair kit.

  • Turn On: Alt-Eye -> Turn On.

  • Safety: Stay close! The generator will light up the area and keep you safe from the darkness.