bhSetWeather(WEATHER_CLEAR, 80, 0x725B32, 199);
// Set Weather
void bhSetWeather(int nWeather, int nSkybox=-1, int nFogColour=-1, int nFogAmount=-1)
{
object oArea = GetArea(GetFirstPC());
if (!GetLocalInt(oArea, "CustomWeather"))
{
SetLocalInt(oArea, "CustomWeather", TRUE);
SetLocalInt(oArea, "Skybox", GetSkyBox(oArea));
SetLocalInt(oArea, "FogColourSun", GetFogColor(FOG_TYPE_SUN, oArea));
SetLocalInt(oArea, "FogColourMoon", GetFogColor(FOG_TYPE_MOON, oArea));
SetLocalInt(oArea, "FogAmountSun", GetFogAmount(FOG_TYPE_SUN, oArea));
SetLocalInt(oArea, "FogAmountMoon", GetFogAmount(FOG_TYPE_MOON, oArea));
}
SetWeather(oArea, nWeather);
if (nSkybox >= 0) SetSkyBox(nSkybox, oArea);
if (nFogColour >= 0) SetFogColor (FOG_TYPE_ALL, nFogColour, oArea);
if (nFogAmount >= 0) SetFogAmount(FOG_TYPE_ALL, nFogAmount, oArea);
}
// Reset weather to area default
void bhResetWeather()
{
object oArea = GetArea(GetFirstPC());
if (!GetLocalInt(oArea, "CustomWeather")) return;
DeleteLocalInt(oArea, "CustomWeather");
SetWeather(oArea, WEATHER_USE_AREA_SETTINGS);
SetSkyBox(GetLocalInt(oArea, "Skybox"), oArea);
SetFogColor (FOG_TYPE_SUN, GetLocalInt(oArea, "FogColourSun"), oArea);
SetFogColor (FOG_TYPE_MOON, GetLocalInt(oArea, "FogColourMoon"), oArea);
SetFogAmount(FOG_TYPE_SUN, GetLocalInt(oArea, "FogAmountSun"), oArea);
SetFogAmount(FOG_TYPE_MOON, GetLocalInt(oArea, "FogAmountMoon"), oArea);
}