Skip to Content

Exports and Integrations

Climatime provides a full set of server and client exports for cross-resource integration. It is a drop-in replacement for qb-weathersync.

Server Exports

Weather

getWeatherState

Returns the current weather type.

local weather = exports['prim_climatime']:getWeatherState() -- Returns: 'CLEAR', 'RAIN', 'SNOW', etc.

setWeather

Sets the weather and broadcasts to all clients.

local success = exports['prim_climatime']:setWeather('RAIN') -- Returns: true on success, false if invalid weather type

Valid weather types: EXTRASUNNY, CLEAR, CLEARING, CLOUDS, OVERCAST, SMOG, FOGGY, RAIN, THUNDER, SNOW, BLIZZARD, SNOWLIGHT, XMAS, HALLOWEEN

getFullWeatherState

Returns the complete weather state table.

local state = exports['prim_climatime']:getFullWeatherState() --[[ Returns: { currentWeather = 'CLEAR', freezeWeather = false, instantChange = false, enableBlackout = false, forceSnowOnGround = false, } ]]

getFreezeWeather

Returns whether weather cycling is frozen.

local frozen = exports['prim_climatime']:getFreezeWeather() -- Returns: true/false

setFreezeWeather

Toggles weather freeze on/off.

exports['prim_climatime']:setFreezeWeather(true) -- freeze exports['prim_climatime']:setFreezeWeather(false) -- unfreeze

Blackout

getBlackoutState

Returns whether blackout mode is active.

local blackout = exports['prim_climatime']:getBlackoutState() -- Returns: true/false

setBlackout

Toggles blackout mode (kills artificial lights).

exports['prim_climatime']:setBlackout(true) -- enable blackout exports['prim_climatime']:setBlackout(false) -- disable blackout

Snow

getSnowState

Returns whether ground snow is active.

local snow = exports['prim_climatime']:getSnowState() -- Returns: true/false

setSnow

Toggles ground snow effects (footsteps, vehicle trails, ice audio).

exports['prim_climatime']:setSnow(true) -- enable snow exports['prim_climatime']:setSnow(false) -- disable snow

Time

getTime

Returns the current server time.

local time = exports['prim_climatime']:getTime() --[[ Returns: { hour = 14, minute = 30, frozen = false, } ]]

setTime

Sets the server time. Triggers a smooth transition on all clients.

exports['prim_climatime']:setTime(6, 0) -- 6:00 AM exports['prim_climatime']:setTime(22, 30) -- 10:30 PM

getTimeFreezeState

Returns whether time is frozen.

local frozen = exports['prim_climatime']:getTimeFreezeState() -- Returns: true/false

setTimeFreeze

Toggles time freeze on/off.

exports['prim_climatime']:setTimeFreeze(true) -- freeze exports['prim_climatime']:setTimeFreeze(false) -- unfreeze

Schedule

getScheduleState

Returns whether the weather schedule cycle is active.

local active = exports['prim_climatime']:getScheduleState() -- Returns: true/false

setScheduleActive

Starts or stops the weather schedule cycle.

exports['prim_climatime']:setScheduleActive(true) -- start cycling exports['prim_climatime']:setScheduleActive(false) -- stop cycling

Client Exports

Sync Control (Housing / Interiors)

Use these exports when players enter housing shells or interiors where you want custom weather and time. While paused, server updates are still received but not applied — so when sync resumes, the latest server state is applied instantly.

PauseSync

Pauses all weather and time sync from the server.

-- Enter interior with default weather (just stops updates) exports['prim_climatime']:PauseSync() -- Enter interior with specific weather exports['prim_climatime']:PauseSync('EXTRASUNNY')

ResumeSync

Resumes weather and time sync. Re-applies the latest server state instantly.

exports['prim_climatime']:ResumeSync()

IsSyncPaused

Returns whether sync is currently paused.

local paused = exports['prim_climatime']:IsSyncPaused() -- Returns: true/false

Read State

GetCurrentWeather

Returns the weather type currently active on this client.

local weather = exports['prim_climatime']:GetCurrentWeather() -- Returns: 'CLEAR', 'RAIN', etc.

GetCurrentTime

Returns the time currently displayed on this client.

local time = exports['prim_climatime']:GetCurrentTime() --[[ Returns: { hour = 14, minute = 30, } ]]

qb-weathersync Compatibility

Climatime registers provide 'qb-weathersync' in its manifest. Any script calling exports['qb-weathersync'] will automatically route to Climatime — no changes needed in those scripts.

-- All of these work automatically with Climatime installed: exports['qb-weathersync']:getWeatherState() exports['qb-weathersync']:setWeather('RAIN') exports['qb-weathersync']:getTime() exports['qb-weathersync']:setTime(12, 0) exports['qb-weathersync']:getBlackoutState() exports['qb-weathersync']:setBlackout(true) exports['qb-weathersync']:getTimeFreezeState() exports['qb-weathersync']:setTimeFreeze(true)

Usage Examples

Housing Script

-- player_enters_shell.lua (client-side) RegisterNetEvent('housing:enterShell', function() exports['prim_climatime']:PauseSync('EXTRASUNNY') end) RegisterNetEvent('housing:exitShell', function() exports['prim_climatime']:ResumeSync() end)

Event Script

-- halloween_event.lua (server-side) RegisterCommand('starthalloween', function() exports['prim_climatime']:setWeather('HALLOWEEN') exports['prim_climatime']:setTime(22, 0) exports['prim_climatime']:setBlackout(true) exports['prim_climatime']:setTimeFreeze(true) end) RegisterCommand('stophalloween', function() exports['prim_climatime']:setWeather('CLEAR') exports['prim_climatime']:setBlackout(false) exports['prim_climatime']:setTimeFreeze(false) end)
Last updated on