# Custom City Blackout

## 🌤 Weather System Integration Guide

If you are using a **different weather system** in your server, you need to integrate its event or export into the function that controls the city’s electric system.

The function is located in `templates.lua` at **line 477**:

```lua
Templates.Action["City Electiric on/off"] = function()
    local wifi = wifiInfo("WF-LS Power & Water wifi network")
    if wifi.connected == false then
        Notify("You must be connected to LS Power & Water's network to control the city electric", "error", 5000)
        return
    end

    Templates.Control["City Electiric"] = not Templates.Control["City Electiric"]
    SetBlackout(Templates.Control["City Electiric"])  

    if Templates.Control["City Electiric"] then
        Notify("City Electric is ON", "success", 5000)
    else
        Notify("City Electric is OFF", "error", 5000)
    end

    TriggerServerEvent("qb-weathersync:server:toggleBlackout", Templates.Control["City Electiric"])
end
```

### 🔧 How to Integrate with Your Own Weather Script

Inside the function above, the following line triggers the **qb-weathersync** blackout event:

```lua
TriggerServerEvent("qb-weathersync:server:toggleBlackout", Templates.Control["City Electiric"])
```

If you are using another weather script, replace this line with your script’s event or export.\
For example:

```lua
-- Example: Replace with the event or export from your own weather script
TriggerServerEvent("myweather:server:toggleBlackout", Templates.Control["City Electiric"])
```

This way, the city electric (blackout) control will integrate with your custom weather system.

***

> **Note:**\
> This integration only affects the **city electric/blackout** feature.\
> For additional weather-related features, please refer to your weather script’s documentation.


---

# 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.0resmon.org/0resmon/s4-resources/s4-flipper-hack-tool/custom-city-blackout.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.
