For the complete documentation index, see llms.txt. This page is also available as Markdown.

qb/qbx weathersync


1. Open the file

Open the following file: qb-weathersync/server.lua

2. Synchronize weather and time

Find the qb-weathersync:server:RequestStateSync event and add the highlighted lines inside it.

RegisterNetEvent('qb-weathersync:server:RequestStateSync', function()
    -- Your existing code...

    -- ===== VMS Needs =====
    local hour = math.floor(((baseTime+timeOffset)/60)%24)
    local minute = math.floor((baseTime+timeOffset)%60)
    TriggerEvent('vms_needs:temperature:update', CurrentWeather, hour, minute)
    -- =====================
end)

3. Synchronize time updates

Find the thread responsible for updating the in-game time and add the highlighted lines inside it.

4. Synchronize weather updates

Find the thread responsible for updating the weather and add the highlighted line inside it.

5. Initiate the first synchronization after the server starts up

Add the following thread at the end of the file.

Last updated