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.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Speed | Game 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 120 | 2 |
| Hour after a restart | The hour the clock starts at when the server starts. | 0 to 23 | 8 |
| Stop the clock | Time stands still at the current hour. | on / off | off |
Changing the speed keeps the current hour: the clock does not jump.
Weather: the weather changes by itself through the list, or stays.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Changing weather | On: the weather moves through the list. Off: the first weather of the list stays. | on / off | on |
| Weathers | GTA weather names in the order they follow. Up to 15. | see below | EXTRASUNNY, CLEAR, CLOUDS, OVERCAST, RAIN, CLEARING, FOGGY |
| Change every | Real minutes between two weather changes. | 1 to 600 min | 20 |
| Blackout | City lights go out (vehicles keep their lights). | on / off | off |
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.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Grip lost in snow | How much wheels slip in XMAS snow. 0 drives like a dry road, GTA's own value is 0.2, 1 is ice. | 0 to 1 | 0 |
| Snow on the ground | Covers the ground white and leaves tyre tracks and footprints while it snows. | on / off | on |
Weather regions tab
Each region is one record. Press New region to add one.
| Setting | What it changes | Values | Default for a new region |
|---|---|---|---|
| Name | The name in the list. | 1 to 48 characters | |
| Centre | The middle of the region on the ground. Use your position or pick it with the camera. | a point | |
| Radius | How far the region reaches from its centre, at any height. | 50 to 6000 m | 600 |
| Weathers | The weathers this region steps through, in order. | weather names, up to 15 | SNOW, SNOWLIGHT |
| Change every | Real minutes between two weather changes in this region. | 1 to 600 min | 20 |
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 callexports['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.