Exports
Public exports registered by nx_fourseasons. All exports are client-side.
nx_fourseasons registers only client-side exports. Call them from
any client script via exports.nx_fourseasons:<Name>().
State
exports.nx_fourseasons:GetCurrentWeatherclientReturn the current weather snapshot for this client.
Returns
{ weather: string, type: string, intensity: number, temperature: number, season: string, storm: table | nil }local w = exports.nx_fourseasons:GetCurrentWeather()
print(w.weather, w.intensity, w.temperature)exports.nx_fourseasons:GetCurrentTemperatureclientReturn the current temperature in Celsius.
Returns
numberlocal temp = exports.nx_fourseasons:GetCurrentTemperature()
if temp < 0 then
-- Player is in sub-zero conditions
endexports.nx_fourseasons:GetCurrentSeasonclientReturn the active season id.
Returns
'SPRING' | 'SUMMER' | 'FALL' | 'WINTER'local season = exports.nx_fourseasons:GetCurrentSeason()exports.nx_fourseasons:GetCurrentTimeclientReturn the synced clock for this client.
Returns
{ hour: number, minute: number, second: number, day: number, month: number, year: number, useRealTime: boolean, freeze: boolean }local t = exports.nx_fourseasons:GetCurrentTime()
print(('%02d:%02d'):format(t.hour, t.minute))exports.nx_fourseasons:GetCurrentStormStateclientReturn the current storm state broadcast by the server. Nil if storms are disabled.
Returns
table | nillocal storm = exports.nx_fourseasons:GetCurrentStormState()exports.nx_fourseasons:IsPlayerIndoorsclientReturn whether the player is currently detected as indoors. Uses a cached check so it is cheap to poll.
Returns
booleanif exports.nx_fourseasons:IsPlayerIndoors() then
-- Skip outdoor-only FX
endForecast
exports.nx_fourseasons:GetForecastclientReturn the server-provided forecast. With no argument, returns the full forecast array. With a day offset, returns that single day.
Parameters
daysAhead?number— 0 for today, 1 for tomorrow, up to Config.ForecastDays - 1.
Returns
table[] | { weather: string, type: string, temperature: number, intensity: number, day?: number, date?: any }-- Full forecast
local days = exports.nx_fourseasons:GetForecast()
-- Single day
local tomorrow = exports.nx_fourseasons:GetForecast(1)
print(tomorrow.weather, tomorrow.temperature)Sync control
Pause or resume the weather and time sync for the local player. Useful for cutscenes, interiors, and minigames that run in an isolated environment.
exports.nx_fourseasons:PauseSyncclientPause or resume weather and time sync on this client. Pending updates are replayed on resume.
Parameters
pausedboolean— true to pause, false to resume.
Returns
boolean-- Freeze weather during a cutscene
exports.nx_fourseasons:PauseSync(true)
-- Resume after
exports.nx_fourseasons:PauseSync(false)exports.nx_fourseasons:RequestSyncclientAsk the server to resend the full weather, forecast, and storm state to this client.
Returns
trueexports.nx_fourseasons:RequestSync()exports.nx_fourseasons:IsSyncPausedclientReturn whether sync is currently paused on this client.
Returns
booleanif exports.nx_fourseasons:IsSyncPaused() then
exports.nx_fourseasons:PauseSync(false)
endRoad traction
Override traction reductions on individual vehicles. Useful for scripted missions where a vehicle should ignore the active weather, or for adding a stronger penalty to a specific vehicle class.
exports.nx_fourseasons:ToggleCurrentRoadEffectsclientEnable or disable the active weather-driven road effect on a vehicle.
Parameters
vehiclenumber— Vehicle entity handle.enabledboolean— true to apply, false to suspend.
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
exports.nx_fourseasons:ToggleCurrentRoadEffects(veh, false)exports.nx_fourseasons:SetVehicleRoadEffectclientOverride the traction reduction applied to a vehicle. Value replaces the active weather default.
Parameters
vehiclenumberoverrideReductionnumber— Traction reduction in the range 0.0 (none) to 1.0 (max).
exports.nx_fourseasons:SetVehicleRoadEffect(veh, 0.5)exports.nx_fourseasons:GetVehicleRoadEffectclientReturn the road-effect state currently tracked for a vehicle.
Parameters
vehiclenumber
Returns
table | nilexports.nx_fourseasons:ResetVehicleRoadEffectclientClear any override set by SetVehicleRoadEffect and reapply the active weather default.
Parameters
vehiclenumber
Screen weather FX
Toggle the screen-space rain drops and the global weather screen overlay per-player. Preferences are kept on the client.
exports.nx_fourseasons:SetRainScreenDropsEnabledclientEnable or disable screen-space rain drops.
Parameters
enabledboolean
Returns
booleanexports.nx_fourseasons:IsRainScreenDropsEnabledclientReturns
booleanexports.nx_fourseasons:ToggleRainScreenDropsclientToggle screen-space rain drops and return the new state.
Returns
booleanexports.nx_fourseasons:SetScreenWeatherEnabledclientEnable or disable the full screen weather overlay (umbrella of screen-space FX driven by the active weather).
Parameters
enabledboolean
Returns
booleanexports.nx_fourseasons:IsScreenWeatherEnabledclientReturns
booleanexports.nx_fourseasons:ToggleScreenWeatherclientToggle the full screen weather overlay and return the new state.
Returns
boolean