Commands#
Zone Weather registers three panel commands behind permissions, two diagnostic commands anyone can run, the lightning aim, and a set of developer tools that only answer while debug is on.
Command | Who | Description |
|---|---|---|
|
| Opens the live control panel: force, hold, lock and reroll weather, set every zone at once, set the clock, toggle the blackout. |
|
| Opens the zone creator. |
|
| Opens the settings panel. |
|
| Toggles lightning aim: aim, left click to strike, |
| Everyone | Names your zone and its weather in a notification, and prints the full client state to the F8 console: zone, weather, sky, sync, clock, blackout, earthquake, tsunami, tornado and blood moon. |
| Everyone | Lists every zone your client knows in the F8 console: weather, points, priority, floor and ceiling, centre, and whether it is locked. |
| Debug on | Developer tools, listed below. They act on your own client only. |
Developer tools (/qsweather)
Switch on Debug output in Settings → General first. Every tool changes only what you see; nobody else is affected.
/qsweather pos # print your coordinates
/qsweather zone # which zone you are standing in
/qsweather set RAIN 10 # blend to a weather over N seconds
/qsweather snap THUNDER # switch to a weather instantly
/qsweather sky <modifier> # preview a timecycle modifier (empty clears it)
/qsweather clock 22 # pin your clock to an hour (empty releases it)
/qsweather water # the water height where you stand
/qsweather quake 15 # feel an earthquake for N seconds
/qsweather blend # what the sky is blending, and how far along
/qsweather sync # stop or resume following the server
/qsweather state # ask the server for everything again
/qsweather bolt # show where lightning would strikeClient Exports#
For a HUD that shows the weather, a phone app with a forecast, or a script that behaves differently in the rain.
Where the player is
-- The zone the player stands in, or nil outside every zone
local zoneId = exports['qs-zoneweather']:getCurrentZone()
-- That zone's weather, or the 'outside every zone' weather when in none
local weather = exports['qs-zoneweather']:getCurrentZoneWeather() -- 'RAIN', 'THUNDER', ...
-- Any zone's weather by id, or nil if the zone does not exist
local other = exports['qs-zoneweather']:getZoneWeather('LOS_ANGELES_COUNTRY')What the sky is doing
-- The weather on screen right now — while crossing a border, the one that dominates the blend
local sky = exports['qs-zoneweather']:GetWeather()
-- The blend in progress: { from, to, percent, blending, zone }, or nil
local blend = exports['qs-zoneweather']:getWeatherBlend()Everything at once
The same snapshot cd_easytime scripts expect:
local data = exports['qs-zoneweather']:GetAllData()
-- {
-- weather = 'CLEAR', -- the weather on screen
-- hours = 12,
-- mins = 30,
-- freeze = false,
-- blackout = false,
-- dynamic = true,
-- instanttime = false,
-- instantweather = false,
-- pauseSync = false, -- paused by a housing or interior script
-- }
local paused = exports['qs-zoneweather']:GetPauseSyncState()Server Exports#
How another resource drives Zone Weather — an event that turns the sky red, a heist that calls in a storm, a script that reads the time.
Reading the weather
local weather = exports['qs-zoneweather']:getZoneWeather('LOS_ANGELES_COUNTRY') -- string or nil
local all = exports['qs-zoneweather']:getAllZoneWeather()
-- { LOS_ANGELES_COUNTRY = 'SMOG', IMPERIAL_COUNTRY = 'EXTRASUNNY', ... }
-- The first zone's weather: handy on a server with a single zone
local first = exports['qs-zoneweather']:getWeatherState()Setting the weather
-- One zone. lock = true stops its cycle until unlocked (or the lock length runs out)
local ok = exports['qs-zoneweather']:setZoneWeather('LOS_ANGELES_COUNTRY', 'TORNADO', false)
-- Every zone at once — the only way to start a tsunami, blood moon or dark hour
local ok = exports['qs-zoneweather']:setAllZonesWeather('TSUNAMI')Both return false for a zone or weather the resource does not know, and setZoneWeather also for a whole-map weather. A weather set without a lock holds for the Manual default length (30 minutes) before the cycle takes over.
Time
local hour, minute = exports['qs-zoneweather']:getTime() -- nil, nil when clock control is off
-- Set the time, optionally freezing it there. false when clock control is off
local ok = exports['qs-zoneweather']:setTime(22, 30, false)
local frozen = exports['qs-zoneweather']:setTimeFreeze(true) -- returns the new state
local frozen = exports['qs-zoneweather']:getTimeFreezeState()With real time on, the hour and minute you pass are ignored: the clock keeps following the real one.
Blackout
local on = exports['qs-zoneweather']:setBlackout(true) -- returns the new state
local on = exports['qs-zoneweather']:getBlackoutState()cd_easytime-style exports
Kept so scripts written for cd_easytime work unchanged:
exports['qs-zoneweather']:GetWeather() -- the first zone's weather
exports['qs-zoneweather']:GetAllData() -- the snapshot shown above
exports['qs-zoneweather']:GetRealData() -- same as GetAllData
exports['qs-zoneweather']:SetWeather('RAIN') -- every zone; false for an unknown weather
exports['qs-zoneweather']:SetTime(12, 0) -- defaults to 12:00Events#
React to the weather without editing the resource: drop a file in server/custom/ — server/custom/example.lua ships as a starting point. Both events are fired on the server and need Broadcast changes left on in Settings → Compatibility.
-- A zone's weather was set: by its cycle, the panel or an export
AddEventHandler('qs-zoneweather:weatherChanged', function(zoneId, weather, previous)
print(('%s went from %s to %s'):format(zoneId, previous, weather))
end)
-- The server clock, every time it is sent to the players
AddEventHandler('qs-zoneweather:timeChanged', function(hour, minute, frozen)
-- e.g. close the shops at night
end)To open the settings panel for a player from your own admin menu:
TriggerClientEvent('qs-zoneweather:admin:openConfig', source)The client still checks the player's permission before opening anything, so this is a shortcut, not a way around it.



