Configuration

All configuration is done in the config/ folder. These files are open (not encrypted), so you can edit them freely. Most settings can also be changed in game from /hzpanel (hz_lib): a value saved in the panel wins over the file.

FilePurpose
config/config.luaMain configuration (general, weather, time, temperature, effects, wind, blackout, disasters, HUD)
config/seasons.luaSeason cycle, starting season and presets
config/zones.luaClimate zones
config/weather.luaWeather cycle outside the zones when the seasons are off
config/time.luaClock pace in milliseconds
config/temperature.luaTemperature per weather type and hybrid mode weights
config/weather_types.luaWeather type properties (temperature, wind, visibility)
config/locales/*.luaTranslations (12 languages)
bridge_schema.luaSettings shown in the /hzpanel Weather module
Updating from an older version? Your old config.lua keeps working. At start, the console names the removed keys your file still sets to a non-default value (DefaultWeather, WeatherChangeInterval, DefaultSeasonPreset, SyncRealWorldSeasons, HeatPeakHour) and tells you what replaces them.

General

Config.Debug = false
Config.Locale = 'en'
Config.AdminPermission = 'admin'
Config.TemperatureUnit = 'C'

ParameterTypeDefaultDescription
DebugbooleanfalseDetailed logs in server/client console
Localestring'en'Language file from config/locales/ (12 included, see Locales). Restart required
AdminPermissionstring'admin'Permission checked for admin access (panel, commands, disasters)
TemperatureUnitstring'C'Display unit: 'C' (Celsius) or 'F' (Fahrenheit)
Who counts as an admin: a player with the ACE named in AdminPermission, or your framework's admin group (ESX admin / superadmin, QBCore / Qbox admin / god). The ACE weather.admin, the ACE command and an hz_lib panel role with the manage right on hz_weather are accepted too. When a player is refused, the server console names the missing permission.

Notifications

Config.Notifications = {
    Season = true,
    SeasonTitle = nil,
    Temperature = false,
}

ParameterTypeDefaultDescription
SeasonbooleantruePopup when the season changes
SeasonTitlestring\nilnilCustom title of that popup (default: season icon + "New season")
TemperaturebooleanfalseCold / heat notifications. Also needs Effects.playerEffects.notifications = true

Weather

Config.DynamicWeather = true
Config.TransitionDuration = 25.0
Config.ZoneTransitionDistance = 800.0
Config.FreezeWeather = false

ParameterTypeDefaultDescription
DynamicWeatherbooleantrueAutomatic weather cycle outside the zones when the seasons are off (list in config/weather.lua). With the seasons on, the season presets drive the weather
TransitionDurationnumber25.0Seconds of fade per weather step when a zone's weather changes
ZoneTransitionDistancenumber800.0Width in meters of the weather blend across a zone border: half before the line, half after
FreezeWeatherbooleanfalseFreeze the weather at startup (no automatic changes)
Available weather types: EXTRASUNNY, CLEAR, CLOUDS, OVERCAST, RAIN, THUNDER, CLEARING, FOGGY, SMOG, SNOW, SNOWLIGHT, BLIZZARD, XMAS, NEUTRAL, plus HALLOWEEN from the panel and the forecast editor.

Weather Influence (Zone Blending)

Config.WeatherInfluence = {
    enabled = true,
    maxDiff = 2,
}

ParameterTypeDefaultDescription
enabledbooleantrueNeighboring zones blend their weather naturally
maxDiffnumber2Max steps on the weather scale between neighbors (1 = strict, 3 = loose)
Weather scale: EXTRASUNNY(1) > CLEAR(2) > CLOUDS(3) > OVERCAST(4) > RAIN(5) > THUNDER(6). With maxDiff = 2, if one zone has THUNDER, the neighbor can be at most OVERCAST.

Weather Outside Zones (config/weather.lua)

This list is only used outside the climate zones when the seasons are off (Config.SeasonsEnabled = false or cycleMode = 'disabled'). With the seasons on, the season presets drive the weather and this list is not used, decemberSnow included. useScheduledWeather applies in every case.

ParameterDefaultDescription
useScheduledWeathertrueRain then thunder before a txAdmin scheduled restart, in every zone except the ones an admin locked
serverDuration14Server uptime in hours before a restart (e.g. restart every 8 h: set 9)
weatherCycletimer90Minutes between two weather changes
timeBetweenRain180Minimum minutes between two rain episodes
rainAfterRestart60Minutes after a restart before rain can appear
decemberSnowtruePermanent snow in December
useStaticWeathertruePick single weathers from staticWeather (chance per type)
useWeatherSequencestruePick ready-made sequences from weatherSequences (sunny, cloudy, snowfall, snowstorm, shower, thunderstorms, big storm), each with its chance, durations in minutes and wind

Time

Config.DayLengthMinutes = 0
Config.NightLengthMinutes = 0
Config.TimeScale = 1.0
Config.FreezeTime = false
Config.StartTime = { hour = 8, minute = 0 }
Config.NightSpeedMultiplier = 1.0
Config.UseRealTime = false
Config.NightTime = { beginning = 22, ending = 6 }

ParameterTypeDefaultDescription
DayLengthMinutesnumber0How many real minutes the day lasts (from NightTime.ending to NightTime.beginning), e.g. 240 = 4 real hours. 0 = use TimeScale
NightLengthMinutesnumber0How many real minutes the night lasts, e.g. 120. 0 = same pace as the day
TimeScalenumber1.0Multiplier on the pace of config/time.lua: 1.0 = that pace (96 min day by default), 2.0 = 2x faster. Ignored when DayLengthMinutes is set
FreezeTimebooleanfalseFreeze time at startup
StartTimetable{hour=8, minute=0}Clock on the very first start only. Later starts resume the saved time
NightSpeedMultipliernumber1.0Night length ratio: 1.0 = same pace as the day, 2.0 = nights 2x longer, 0.5 = nights half as long. Ignored when a length is set
UseRealTimebooleanfalseFollow the server's real clock (every speed setting is then ignored)
NightTimetable{beginning=22, ending=6}Hours defining the night period
Minimum pace: 1 game minute per real second. A 16 h day (06:00 to 22:00) needs DayLengthMinutes = 16 or more, an 8 h night NightLengthMinutes = 8 or more. Below that, the console warns and caps the pace.

Clock Pace (config/time.lua)

ParameterDefaultDescription
timeScale4000Milliseconds per in-game minute (4000 = 96 min full day). Config.TimeScale multiplies it
useNightScalefalseUse timeScaleNight during the night hours
timeScaleNight8000Milliseconds per in-game minute at night

Temperature

Config.TemperatureEnabled = true
Config.TemperatureMode = 'hybrid'
Config.TemperatureUpdateInterval = 5
Config.TemperatureRandomVariation = 2.0

ParameterTypeDefaultDescription
TemperatureEnabledbooleantrueEnable temperature system. Off = no temperature shown anywhere (HUD, phone app, effects)
TemperatureModestring'hybrid'Calculation mode (see below)
TemperatureUpdateIntervalnumber5Seconds between recalculations
TemperatureRandomVariationnumber2.0Random variation in degrees (±)
Temperature modes:
  • 'zone': based only on the zone's min/max range
  • 'weather': based only on the current weather type
  • 'hybrid': combines both (recommended)

Hour Modifiers (Day/Night Curve)

Config.TemperatureHourModifiers = {
    [0]  = -8,    -- Midnight
    [4]  = -10,   -- 4 AM (coldest)
    [8]  = -3,    -- 8 AM (sunrise)
    [12] = 3,     -- Noon
    [14] = 5,     -- 2 PM (peak)
    [20] = 1      -- 8 PM (evening)
}

Values are added to the base temperature. Hours in between are interpolated automatically. This curve is used when the seasons are off and for ignoreSeason zones; with the seasons on, each season's temperatureModifiers set the day/night curve.

Weather Modifiers (config/temperature.lua)

ParameterDefaultDescription
weatherModifiersEXTRASUNNY = 8 to BLIZZARD = -25°C added per weather type (e.g. RAIN = -6, SNOW = -15, SMOG = 3)
hybridWeights{ zone = 0.6, weather = 0.4 }Share of the zone range and of the weather type in 'hybrid' mode

Seasons

Config.SeasonsEnabled = true

ParameterTypeDefaultDescription
SeasonsEnabledbooleantrueEnable season system (can be toggled live from /hzpanel)
The cycle mode, the season length, the starting season and the presets are set in config/seasons.lua: see Season Presets below.

Gameplay Effects

All effects are configured under Config.Effects:

Vehicle Traction

vehicleTraction = {
    enabled = false,
    rainModifier = 0.7,
    snowModifier = 0.5,
    blizzardModifier = 0.3,
}

ParameterTypeDefaultDescription
enabledbooleanfalseEnable traction modification
rainModifiernumber0.770% grip in rain
snowModifiernumber0.550% grip in snow
blizzardModifiernumber0.330% grip in blizzard

Reduced Visibility

reducedVisibility = {
    enabled = true,
}

ParameterTypeDefaultDescription
enabledbooleantrueFog in bad weather (FOGGY, SMOG, RAIN, THUNDER, SNOW, BLIZZARD). It follows the sky and fades in, it does not appear at once

Player Effects (Cold / Heat)

playerEffects = {
    enabled = true,
    notifications = true,
    freezing = true,
    heatStroke = true,
    coldThreshold = 10,
    heatThreshold = 30,
    screenFx = true,
}

ParameterTypeDefaultDescription
enabledbooleantrueEnable player weather effects (not inside interiors)
notificationsbooleantrueNotification when entering a cold / heat state. Off by default since 1.4.2 because Config.Notifications.Temperature is false: set both to true to get them. One notification per 2 minutes per state at most
freezingbooleantrueShivering animation, screen frost
heatStrokebooleantrueSweat animation, screen distortion
coldThresholdnumber10Below this temperature (°C) = cold effects. 2 °C hysteresis: once cold, the temperature must rise to coldThreshold + 2 before the effects switch off
heatThresholdnumber30Above this temperature (°C) = heat effects. 2 °C hysteresis: once hot, the temperature must drop to heatThreshold - 2 before the effects switch off
screenFxbooleantrueEnable screen post-processing effects

Speed Reduction

speedReduction = {
    enabled = false,
    blizzardModifier = 0.85,
}

When enabled, players sprint at 85% speed during blizzard conditions.

NPC Population After a Disaster

Config.RestorePopulationBudget = 3

NPC population budget (0-3) given back after a tsunami or a tornado. Set it to your server's value if another script lowers it.


Wind

Config.WindEnabled = true
Config.WindUpdateInterval = 10
Config.WindGustsEnabled = true
Config.WindGustsProbability = 0.2
Config.WindGustsMultiplier = 1.5

ParameterTypeDefaultDescription
WindEnabledbooleantrueEnable wind system. The speed follows the weather of the player's zone
WindUpdateIntervalnumber10Seconds between wind updates. The direction drifts, it does not jump
WindGustsEnabledbooleantrueEnable random wind gusts
WindGustsProbabilitynumber0.220% chance of gust per update
WindGustsMultipliernumber1.5Gust strength multiplier

Blackout

Config.BlackoutEnabled = true
Config.BlackoutAffectsVehicles = false
Config.BlackoutExceptions = {}

ParameterTypeDefaultDescription
BlackoutEnabledbooleantrueEnable blackout system
BlackoutAffectsVehiclesbooleanfalseVehicle headlights also turn off
BlackoutExceptionsstring[]{}Climate zones that keep their lights during a blackout, by zone name, e.g. { 'sandy_shores', 'paleto' }
The blackout is started and stopped from the panel map, the SetBlackout export or the qb-weathersync compatibility layer. Exceptions are whole climate zones, not single buildings. An unknown zone name is reported in the console at start.

Tornado

Config.Tornado = { ... }

General

ParameterTypeDefaultDescription
EnabledbooleantrueEnable tornado system
Commandstring'tornado'Admin command name (/tornado start\|stop\|instant\|pause\|status)
WarningDurationnumber30Alert before touchdown (seconds)
ActiveDurationnumber180Active on ground (seconds)
DissipatingDurationnumber30Dissipation fadeout (seconds)
IntensityRampUpnumber30Seconds to reach 100% intensity
TickIntervalnumber50Server update interval (ms)
WeatherRadiusnumber500.0Radius (meters) around the tornado where the weather switches to THUNDER
DisableTrafficbooleantrueDisable NPC traffic during the event

Movement

ParameterTypeDefaultDescription
MovementEnabledbooleantrueTornado moves across the map
MoveSpeednumber0.3Movement speed (units/tick)
DestinationMinDistnumber80.0Min distance for next waypoint
DestinationMaxDistnumber250.0Max distance for next waypoint

Visual (Particle System)

ParameterTypeDefaultDescription
ParticleLayersnumber8Vertical particle layers
ParticlesPerLayernumber2Particles per layer
BaseRadiusnumber9.4Base funnel radius
LayerSeparationnumber22.0Vertical spacing between layers
RotationSpeednumber2.0Rotation speed (rad/s)
GirthModifiernumber5.0Top-of-funnel flare
ParticleBaseScalenumber3.0Base particle size
DebrisLayersnumber2Dark debris layers at base
DebrisScalenumber4.7Debris particle scale
CloudTopLayersnumber2Wide cloud layers at top
CloudTopScalenumber10.0Cloud top scale
CloudTopRadiusMultnumber2.0Cloud top radius multiplier
CloudTopSpeedMultnumber0.16Cloud top rotation speed

Physics (3-Force Vortex Model)

ParameterTypeDefaultDescription
HorizontalPullForcenumber1.2Attraction toward center
VerticalForcenumber1.0Upward lift force
TangentialForcenumber0.8Spinning/rotational force
ForceScalenumber2.0Global force multiplier
MaxEntitySpeednumber35.0Speed cap for thrown entities
EntityCollectRadiusnumber45.0Radius to detect entities
MaxTrackedEntitiesnumber20Max simultaneous tracked entities
ThrowVehiclesbooleantrueThrow NPC vehicles
ThrowPedsbooleantrueThrow NPCs
ThrowObjectsbooleanfalseThrow world props (disabled: may crash GTA)
AffectPlayerbooleantruePlayer gets pulled (ragdoll + forces)
PlayerForceMultipliernumber1.2Force multiplier on player
ShockingEventsbooleantrueNPCs flee and scream

Debris Props

ParameterTypeDefaultDescription
SpawnDebrisbooleantrueSpawn flying debris objects
MaxDebrisPropsnumber5Max simultaneous debris
DebrisSpawnMinnumber3000Min spawn interval (ms)
DebrisSpawnMaxnumber6000Max spawn interval (ms)
DebrisLifetimenumber6500Debris lifetime (ms)
DebrisModelsstring[]{...}Prop model names to use

Visual Effects (Tornado.Effects)

ParameterTypeDefaultDescription
CameraShakebooleantrueCamera shake near the tornado
ShakeIntensitynumber0.3Shake intensity (0.0-1.0)
ShakeRadiusnumber200.0Shake radius (meters)
ScreenOverlaybooleantrueScreen overlay
OverlayAlphanumber25Overlay opacity (0-255)
TimecyclebooleantrueDark atmosphere timecycle
TimecycleModifierstring'MP_Killstreak'Timecycle modifier name
ForceWeatherbooleantrueForce THUNDER within WeatherRadius
ForceWindbooleantrueIncrease wind speed
WindSpeednumber15.0Wind speed during the tornado

Notification Messages

ParameterDefaultTrigger
WarningMessage'~r~TORNADO ALERT~s~ — Seek shelter immediately!'Warning start
TouchdownMessage'~r~TORNADO~s~ — Touchdown confirmed'Touchdown
DissipatingMessage'~y~TORNADO~s~ — The tornado is dissipating'Dissipating start
EndMessage'~g~TORNADO OVER~s~ — Returning to normal'Event end

Tsunami

Config.Tsunami = { ... }

General

ParameterTypeDefaultDescription
EnabledbooleantrueEnable tsunami system
Commandstring'tsunami'Admin command name (/tsunami start\|stop\|instant\|pause\|status)
WarningDurationnumber120Seconds of siren before the water rises (time to evacuate)
MaxWaterHeightnumber200.0Maximum water height (meters)
RiseSpeednumber0.08Meters per tick while rising
RecedeSpeednumber0.04Meters per tick while receding
MaxRecedeSecondsnumber60The recede never takes longer: faster steps when RecedeSpeed is too slow
TickIntervalnumber100Milliseconds between ticks
PeakDurationnumber300Seconds at max height (5 min)
DisableTrafficbooleantrueDisable NPC traffic during tsunami
PedsDieInWaterbooleantrueNPCs die when submerged
PedsCanSwimbooleantrueNPCs can swim underwater

Aftermath Mode

ParameterTypeDefaultDescription
Modestring'spectacle''spectacle' = quick reset after the recede. 'survival' = the water stays for SurvivalDurationMinutes, then recedes, so the RP can play out
SurvivalDurationMinutesnumber30How long the water stays in 'survival' mode

Visual Effects (Tsunami.Effects)

ParameterTypeDefaultDescription
ForceWeatherbooleanfalsefalse = keep the players' current sky. true = force WeatherType
WeatherTypestring'OVERCAST'Forced weather when ForceWeather = true ('OVERCAST', 'CLOUDS', 'THUNDER'...)
ForceWindbooleantrueStrong wind for the whole event
WindSpeednumber12.0Wind speed during tsunami
CameraShakebooleanfalseCamera shake during event
ShakeIntensitynumber0.3Shake intensity (0.0-1.0)
ScreenOverlaybooleanfalseBlue/cyan screen overlay
OverlayAlphanumber40Overlay opacity (0-255)
TimecyclebooleanfalseDark atmosphere timecycle
TimecycleModifierstring'MP_Killstreak'Timecycle modifier name

Sirens and Voice (Tsunami.Sounds)

ParameterTypeDefaultDescription
EnabledbooleantrueEnable tsunami sounds
SirenEnabledbooleantrue3D sirens at the SirenPoints (needs xsound)
SirenVolumenumber0.25Max siren volume (0.0-1.0)
SirenDistancenumber1000.0Audible radius of each siren (meters)
SirenDuckFactornumber0.2Siren volume while the voice talks (0.0-1.0)
VoiceEnabledbooleantrueCivil-defense voice alerts, played from the speaker nearest the player
VoiceVolumenumber1.0Voice gain (0.0-2.0)
VoiceRefDistancenumber150Below this distance the voice is at max volume
VoiceMaxDistancenumber3000At this distance the voice fades to silence
SirenPointsvector3[]12 pointsSpeaker positions (Port of Los Santos, Del Perro Pier, Vespucci Beach, Paleto Bay, Mt Chiliad...). Add your own for a custom coastline
The sirens need the xsound resource: without it, the tsunami still runs but the sirens stay silent. The voice alerts do not use xsound. They ship in English and French, chosen from Config.Locale.

Notification Messages

ParameterDefaultTrigger
WarningMessage'~r~TSUNAMI ALERT~s~ — Evacuate to higher ground!'Warning start
PeakMessage'~b~TSUNAMI~s~ — Maximum level reached'Peak reached
RecedeMessage'~g~TSUNAMI~s~ — Waters are receding'Receding start
EndMessage'~g~TSUNAMI OVER~s~ — Returning to normal'Event end

Database

Config.SaveConfigToDB = true

ParameterTypeDefaultDescription
SaveConfigToDBbooleantrueSave the zone temperature ranges changed from the panel map
The tables are created automatically on first start (see Installation).

Compatibility

Config.EnableQBCompat = true

ParameterTypeDefaultDescription
EnableQBCompatbooleantrueExpose qb-weathersync exports and events. Restart required
Set it to false if no script on your server depends on qb-weathersync. The cd_easytime layer (cd_easytime:PauseSync) and the vSync layer (vSync:toggle, vSync:updateWeather, vSync:requestSync) are always on.

Cayo Perico

Config.CayoPerico = true

ParameterTypeDefaultDescription
CayoPericobooleantrueEnable the Cayo Perico zone and its map image. Restart required

HUD

Config.HUD = {
    Enabled = true,
    UpdateInterval = 5000,
}

ParameterTypeDefaultDescription
EnabledbooleantrueShow in-game weather HUD
UpdateIntervalnumber5000HUD refresh rate (milliseconds)

Performance

Config.MaxHistoryDays = 30
Config.CleanHistoryOnStart = true

ParameterTypeDefaultDescription
MaxHistoryDaysnumber30Days of history to keep in database
CleanHistoryOnStartbooleantrueClean old history on resource start

Climate Zones (config/zones.lua)

The 10 shipped zones: paleto, mont_josiah, sandy_shores, banham_canyon, vinewood_hills, vinewood, tataviam_mountains, palomino_highlands, los_santos and cayo_perico (circle, ignoreSeason = true). Zone names are the ones exports, commands and BlackoutExceptions use.

FieldDescription
nameUnique id
labelDisplay name per language
zoneType'circle' (center, radius, useZ) or 'poly' (points, minZ, maxZ)
priority1-10, the higher wins where zones overlap
weatherBase weather. With the seasons on, the season sets the weather of every zone except ignoreSeason zones
ignoreSeasontrue = the zone keeps its own weather (no season, no neighbor influence), only an admin changes it
temperature{ min, max } in °C
isActivetrue / false
neighborsNeighbor zones for the weather gradient
A zone saved from the panel zone editor lives in the hz_weather_zones table, and that row wins over config/zones.lua for its shape, base weather and temperature (the server console lists these zones at start). To give a zone back to the file, reset it in the editor or delete its row.

Weather set by an admin (panel or command) is locked and survives restarts until it is unlocked: lock badge on the panel map, or /weatherunlock <zone|all>.


Season Presets (config/seasons.lua)

This file defines the cycle, the 4 season presets and the transitions.

Cycle Mode

cycleMode = 'auto'  -- 'disabled', 'auto', 'realtime'

  • disabled: no season cycle (manual weather)
  • auto: the seasons rotate automatically, in seasonOrder, starting from startingSeason
  • realtime: the seasons follow the server's real calendar (realtimeMapping: December to February = winter, March to May = spring, June to August = summer, September to November = autumn)
The mode picked in the panel's Seasons tab is kept after a restart.

Season Length and Starting Season

cycleDuration = 120         -- Length of ONE season in real minutes ('auto' mode)
startingSeason = 'spring'   -- 'spring', 'summer', 'autumn', 'winter'

120 = each season lasts 2 real hours (8 h for the 4). The season changes when the weather entry running at that time ends.

Preset Structure

Each season defines a weather sequence and temperature modifiers:

spring = {
    label = { fr = "Printemps", en = "Spring", es = "Primavera", de = "Frühling" },
    icon = "...",

    -- Played in order. Durations are REAL minutes
    weatherSequence = {
        { weather = 'CLEAR',    duration = 80 },
        { weather = 'CLOUDS',   duration = 60 },
        { weather = 'OVERCAST', duration = 45 },
        { weather = 'CLEARING', duration = 35 },
        { weather = 'RAIN',     duration = 50 },
        { weather = 'CLEARING', duration = 40 },
    },

    temperatureModifiers = {
        base = 16.0,
        morning = -3,
        afternoon = 5,
        night = -6,
    },
}

Season Transitions

transitions = {
    enabled = true,
    duration = 2,  -- Transition duration (real minutes)
    transitionWeather = {
        ['spring_to_summer'] = 'CLEAR',
        ['summer_to_autumn'] = 'CLOUDS',
        ['autumn_to_winter'] = 'OVERCAST',
        ['winter_to_spring'] = 'CLEARING',
    },
}

Advanced

ParameterDefaultDescription
allowSkiptrueAllow admins to skip a season
saveToDBtrueSave the season progress in the database
updateInterval60Update interval (seconds)
notifyPlayerstrueNotify players when the season changes

Locales (config/locales/)

12 languages are included: en, fr, es, de, pt, it, tr, ru, pl, zh, ja, ko. Set the active one in config/config.lua (or in /hzpanel), then restart the resource:

Config.Locale = 'en'

An unknown locale falls back to English.

Adding a New Language

  1. Copy config/locales/en.lua to config/locales/xx.lua
  2. Translate all string values
  3. Set Config.Locale = 'xx' in config/config.lua (the panel only lists the 12 included languages)
return {
    ['key_name'] = 'Translated string',
    ['weather_changed'] = 'Weather changed to %s',
}

After modifying config files, restart the resource with ensure hz_weather or restart the server.