AI Core

ai-weathersync

Time and weather, the same for every player, with weather regions and snow. Stands in for qb-weathersync.

ai-weathersync makes every player see the same clock and the same weather. You set how fast the day passes, which weathers follow each other and how often the weather changes in the admin panel. Parts of the map can have their own weather (snow on Mount Chiliad while the city is sunny).

What it does in the game

  • One clock for everyone. The server keeps the time. Each player's game runs the clock at the same speed, so the time never jumps back and forth.
  • Changing weather. The weather steps through your list, one or two steps at a time, every few minutes. Rain clears before the sun comes back.
  • Weather regions. A region is a circle on the map with its own weather list. A player inside the circle sees the region's weather. Where circles overlap, the smallest one wins.
  • Snow. In snow weathers the ground can turn white and keep tyre tracks and footprints, and wheels can slip.
  • Blackout. City lights go out. Vehicle lights still work.
  • Interiors. Scripts that need their own light (character screen, houses, shells) pause the sync through AI Core. ai-weathersync stops while any script holds a pause and continues when the last one lets go.

Installation

The AI Core txAdmin recipe installs it. By hand: put the folder in resources/[ai]/ and add ensure ai-weathersync to server.cfg after ensure ai-core. It needs OneSync and ai-core. It has no database table.

Do not run qb-weathersync or another weather script next to it: AI Core reports the second one in the console and refuses players while both run.

Panel settings

Open the admin panel (F10) and pick Time and weather.

Time and weather tab

Time: the in-game clock every player sees.

SettingWhat it changesValuesDefault
SpeedGame minutes that pass in one real minute. 2 makes a game day last 12 real hours; 30 is GTA Online's 48-minute day.0.1 to 1202
Hour after a restartThe hour the clock starts at when the server starts.0 to 238
Stop the clockTime stands still at the current hour.on / offoff

Changing the speed keeps the current hour: the clock does not jump.

Weather: the weather changes by itself through the list, or stays.

SettingWhat it changesValuesDefault
Changing weatherOn: the weather moves through the list. Off: the first weather of the list stays.on / offon
WeathersGTA weather names in the order they follow. Up to 15.see belowEXTRASUNNY, CLEAR, CLOUDS, OVERCAST, RAIN, CLEARING, FOGGY
Change everyReal minutes between two weather changes.1 to 600 min20
BlackoutCity lights go out (vehicles keep their lights).on / offoff

The weather names you can use: EXTRASUNNY, CLEAR, NEUTRAL, SMOG, FOGGY, OVERCAST, CLOUDS, CLEARING, RAIN, THUNDER, SNOW, BLIZZARD, SNOWLIGHT, XMAS, HALLOWEEN.

Snow: how snow weathers (SNOW, SNOWLIGHT, BLIZZARD, XMAS) feel.

SettingWhat it changesValuesDefault
Grip lost in snowHow much wheels slip in XMAS snow. 0 drives like a dry road, GTA's own value is 0.2, 1 is ice.0 to 10
Snow on the groundCovers the ground white and leaves tyre tracks and footprints while it snows.on / offon

Weather regions tab

Each region is one record. Press New region to add one.

SettingWhat it changesValuesDefault for a new region
NameThe name in the list.1 to 48 characters
CentreThe middle of the region on the ground. Use your position or pick it with the camera.a point
RadiusHow far the region reaches from its centre, at any height.50 to 6000 m600
WeathersThe weathers this region steps through, in order.weather names, up to 15SNOW, SNOWLIGHT
Change everyReal minutes between two weather changes in this region.1 to 600 min20

Each region changes on its own timer. Editing one region restarts only that region's timer.

Commands

None of its own. Admin commands for time and weather (in ai-admin) go through AI Core, which calls ai-weathersync.

Keybinds

None.

Works with other scripts

  • Stands in for qb-weathersync (provide 'qb-weathersync'). Scripts that call exports['qb-weathersync']:setWeather(...) and the other qb-weathersync exports reach ai-weathersync.
  • Pause events of other scripts (qb-weathersync:client:DisableSync / EnableSync, cd_easytime:PauseSync, vSync:toggle) are turned into AI Core pauses, so a house or interior script made for another weather script still pauses this one.
  • You can replace it. AI Core also works with Renewed-Weathersync, av_weather, cd_easytime and qb-weathersync. Remove ai-weathersync and start one of those; admin commands and scripts keep working through AI Core. See Compatibility.

Known limits

  • Blackout, a stopped clock and changing weather set by a command or an export last until the panel setting changes or the resource restarts. Then the panel's value counts again.
  • After a full server restart the clock starts at Hour after a restart. Restarting only ai-weathersync keeps the current time.

On this page