RedM Natives

APPLY_WEATHER_CYCLES

Hash0x3422291C
Runtime nameApplyWeatherCycles
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

BOOL APPLY_WEATHER_CYCLES(int numEntries, int msPerCycle);

Parameters

NameTypeDescription
numEntriesint

The number of cycle entries. Must be between 1 and 256

msPerCycleint

The duration in milliseconds of each cycle. Must be between 1000 and 86400000 (24 hours)

Returns BOOL — Returns true if all parameters were valid, otherwise false.

Usage

Lua
local retval = ApplyWeatherCycles(numEntries, msPerCycle)

-- always works, by hash
local retval = Citizen.InvokeNative(0x3422291c, numEntries, msPerCycle, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = ApplyWeatherCycles(numEntries, msPerCycle);

// by hash
const retval = Citizen.invokeNative('0x3422291c', numEntries, msPerCycle, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0x3422291c, numEntries, msPerCycle);

Examples

LUA · Cfx.re native reference
-- Cycle between XMAS weather for 30 seconds (3 * 10000 milliseconds), and SMOG weather for 20 seconds (2 * 10000 milliseconds)
local success = SetWeatherCycleEntry(0, "XMAS", 3) and
                SetWeatherCycleEntry(1, "SMOG", 2) and
                ApplyWeatherCycles(2, 10000)

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.