APPLY_WEATHER_CYCLES
Signature
BOOL APPLY_WEATHER_CYCLES(int numEntries, int msPerCycle);Parameters
| Name | Type | Description |
|---|---|---|
numEntries | int | The number of cycle entries. Must be between 1 and 256 |
msPerCycle | int | 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
local retval = ApplyWeatherCycles(numEntries, msPerCycle)
-- always works, by hash
local retval = Citizen.InvokeNative(0x3422291c, numEntries, msPerCycle, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = ApplyWeatherCycles(numEntries, msPerCycle);
// by hash
const retval = Citizen.invokeNative('0x3422291c', numEntries, msPerCycle, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0x3422291c, numEntries, msPerCycle);Examples
-- 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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.