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:

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:

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:

-- 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.

Last updated