Skip to content

Weather and time

qb-weathersync, Renewed-Weathersync and esx_weather work out of the box. For another script fill in these entries in editable/framework.lua.

EntryReceivesReturns
weatherState—{ supported, script, caps, time = { hour, minute }, weather }
setTimehour (0–23), minute (0–59)true / false
setWeathername, e.g. 'CLEAR', 'RAIN', 'THUNDER'true / false

caps decides which buttons the dashboard shows: { time = true, weather = true, freeze = false, blackout = false }.

editable/framework.lua
EditableServer.weatherState = {
custom = true,
fn = function()
local hour, minute = exports['my_weather']:GetTime()
return { supported = true, script = 'my_weather', caps = { time = true, weather = true },
time = { hour = hour, minute = minute }, weather = exports['my_weather']:GetWeather() }
end,
}