itsjarrett / fivem-dinoweather Goto Github PK
View Code? Open in Web Editor NEWA Weather System that enhances realism by using GTA Natives relating to Zones.
License: GNU Affero General Public License v3.0
A Weather System that enhances realism by using GTA Natives relating to Zones.
License: GNU Affero General Public License v3.0
For me the ressource is “kinda” working. I am able to set the weather (in zones) while I’m ingame. But my script seems not to be working, it doesn’t set up different weather zones like in my config.
`WeatherConfig = {}
WeatherConfig = setmetatable(WeatherConfig, {})
activeWeatherSystems = {}
WeatherConfig.snowEnabled = true -- Set to false if you do not want snow enabled.
WeatherConfig.decemberSnowDays = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 } -- Days that snow will appear during the month of December.
WeatherConfig.weatherTypes = {
"CLEAR",
"EXTRASUNNY",
"CLOUDS",
"OVERCAST",
"RAIN",
"CLEARING",
"THUNDER",
"SMOG",
"FOGGY",
"XMAS",
"SNOWLIGHT",
"BLIZZARD"
}
WeatherConfig.randomizeTime = 1800000 -- 1 Hour (TIME TO RANDOMIZE WEATHER SYSTEMS IN MILLISECONDS)
WeatherConfig.weatherSystems = {
{
{ "TERMINA", "ELYSIAN", "AIRP", "BANNING", "DELSOL", "RANCHO", "STRAW", "CYPRE", "SANAND" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- South LS
{
{ "MURRI", "LMESA", "SKID", "LEGSQU", "TEXTI", "PBOX", "KOREAT" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- Central LS
{
{ "MIRR", "EAST_V", "DTVINE", "ALTA", "HAWICK", "BURTON", "ROCKF", "MOVIE", "DELPE", "MORN", "RICHM", "GOLF", "WVINE", "DTVINE", "HORS", "LACT", "LDAM" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- North LS
{
{ "BEACH", "VESP", "VCANA", "DELBE", "PBLUFF" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- LS Beaches
{
{ "EBURO", "PALHIGH", "NOOSE", "TATAMO" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- Eastern Valley
{
{ "BANHAMC", "BANHAMCA", "CHU", "TONGVAH" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- Coastal Beaches
{
{ "CHIL", "GREATC", "RGLEN", "TONGVAV" },
{ WeatherConfig.weatherTypes[9], WeatherConfig.weatherTypes[10] }
}, -- North LS Hills
{
{ "PALMPOW", "WINDF", "RTRACK", "JAIL", "HARMO", "DESRT", "SANDY", "ZQ_UAR", "HUMLAB", "SANCHIA", "GRAPES", "ALAMO", "SLAB", "CALAFAB" },
{ WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
}, -- Grand Senora Desert
{
{ "MTGORDO", "ELGORL", "BRADP", "BRADT", "MTCHIL", "GALFISH" },
{ WeatherConfig.weatherTypes[1], WeatherConfig.weatherTypes[12] }
}, -- Northern Moutains
{
{ "LAGO", "ARMYB", "NCHU", "CANNY", "MTJOSE", "CCREAK" },
{ WeatherConfig.weatherTypes[2], WeatherConfig.weatherTypes[3] }
}, -- Zancudo
{
{ "CMSW", "PALCOV", "OCEANA", "PALFOR", "PALETO", "PROCOB" },
{ WeatherConfig.weatherTypes[1], WeatherConfig.weatherTypes[12] }
}, -- Palteo
}
WeatherConfig.timesOfYear = {
{ 3, 4, 5 }, --SPRING 1
{ 6, 7, 8 }, --SUMMER 2
{ 9, 10, 11 }, --FALL 3
{ 12, 1, 2 } --WINTER 4
}
function getCurrentSeason()
for i, timeOfYear in ipairs(WeatherConfig.timesOfYear) do
for k, month in ipairs(WeatherConfig.timesOfYear[i]) do
if month == os.date("*t").month then
return i
end
end
end
end
function isSnowDay()
for i, decemberSnowDay in ipairs(WeatherConfig.decemberSnowDays) do
if decemberSnowDay == os.date("*t").day then
return true
end
end
return false
end
function findZoneBySubZone(zoneName)
for i, weatherSystem in ipairs(WeatherConfig.weatherSystems) do
for _, weatherZone in ipairs(weatherSystem[1]) do
if weatherZone == zoneName then
return i
end
end
end
end
function randomizeSystems()
activeWeatherSystems = {}
for i, weatherSystem in ipairs(WeatherConfig.weatherSystems) do
local currentSeason = getCurrentSeason()
local availableWeathers = weatherSystem[currentSeason + 1]
local pickedWeather = availableWeathers[math.random(1, #availableWeathers)]
for _, weatherZone in ipairs(weatherSystem[1]) do
if os.date("*t").month == 12 and isSnowDay() and WeatherConfig.snowEnabled then
table.insert(activeWeatherSystems, {weatherZone, "XMAS"})
else
table.insert(activeWeatherSystems, {weatherZone, pickedWeather})
end
end
end
end`
Anything wrong on my end?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.