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

Weather & Time

To ensure the cinematic cameras, lighting, and skies look perfect during the character selection phase, ak47_multicharacter forces the weather to CLEAR and time to 00:00 (Midnight) or whatever is set by your lighting config.

To prevent your server's time/weather sync script from fighting with the multicharacter screen (which causes screen flickering), you need to pause your sync script.

The script natively pauses cd_easytime and qb-weathersync. If you use something else (like vSync or a custom script), follow the steps below.

Modifying custom/client.lua

Open custom/client.lua and locate the Custom_StartTimeLoop() and Custom_StopTimeLoop() functions.

1. Pausing Sync (Start Time Loop)

Add an event trigger to pause your specific weather script.

function Custom_StartTimeLoop()
    if not timeLoop then
        timeLoop = true
        
        -- Default Integrations
        if GetResourceState('cd_easytime') == 'started' then
            TriggerEvent('cd_easytime:PauseSync', true, 1)
        else
            if GetResourceState('qb-weathersync') == 'started' then
                TriggerEvent('qb-weathersync:client:DisableSync')
            end
            
            -- ADD YOUR CUSTOM PAUSE EVENT HERE
            -- TriggerEvent('my_weathersync:pause', true)
            
            -- Built-in Override Loop
            CreateThread(function()
                while timeLoop do
                    Wait(1)
                    NetworkOverrideClockTime(1, 0, 0)
                    ClearOverrideWeather()
                    ClearWeatherTypePersist()
                    SetWeatherTypePersist('CLEAR')
                    SetWeatherTypeNow('CLEAR')
                    SetWeatherTypeNowPersist('CLEAR')
                end
            end)
        end
    end
end

2. Resuming Sync (Stop Time Loop)

Add an event trigger to resume your weather script once the player has spawned into the world.

Last updated