Giter VIP home page Giter VIP logo

fivem-dinoweather's People

Contributors

blumlaut avatar itsjarrett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fivem-dinoweather's Issues

Parcially working

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.