[FREE RELEASE] B2 Weather Essentials - Dynamic Weather System for FiveM
Introduction
Greetings, FiveM community!
I’m excited to introduce B2 Weather Essentials, a comprehensive dynamic weather system designed to enhance your FiveM server’s realism and immersion. This resource brings synchronized weather changes, real-time local weather integration, and easy admin controls to your server.
Features
- Dynamic Weather Options: Supports all FiveM weather types, including clear skies, thunderstorms, fog, and snow.
- Configurable Weather Chances: Adjust the probability of each weather type occurring to keep the environment dynamic.
- Interval-Based Weather Changes: Set how often the weather changes automatically.
- Admin Commands: Simple commands for admins to manually change the weather.
- Live Local Weather Integration: Syncs in-game weather with real-world weather using the Open-Meteo API.
Installation
- Download the resource from the link below and place it in your FiveM server’s resources folder.
- Add the resource to your
server.cfg
:ensure b2_weatherEssentials
Configuration
Edit the config.lua
file to set up the weather types, chances, intervals, and API settings:
Config = {
WeatherTypes = {"CLEAR", "EXTRASUNNY", "CLOUDS", "OVERCAST", "RAIN", "CLEARING", "THUNDER", "SMOG", "FOGGY", "XMAS", "SNOWLIGHT", "BLIZZARD"},
WeatherChances = {CLEAR = 20, EXTRASUNNY = 15, CLOUDS = 10, OVERCAST = 10, RAIN = 10, CLEARING = 5, THUNDER = 5, SMOG = 5, FOGGY = 5, XMAS = 5, SNOWLIGHT = 5, BLIZZARD = 5},
WeatherChangeInterval = 30,
UseLiveWeather = true,
Latitude = "your_latitude",
Longitude = "your_longitude"
}
Commands
/setweather [weather]
: Allows admins to manually set the weather. Example:/setweather CLEAR
. Requires thecommand.setweather
ACE permission.
API Exports
Easily integrate the weather system with other scripts:
SetWeather(weather)
: Sets the weather to the specified type.GetCurrentWeather()
: Returns the current weather type.
Example Usage
Setting Weather from Another Script:
Citizen.CreateThread(function()
Wait(10000) -- Wait for 10 seconds
exports['b2_weatherEssentials']:SetWeather('THUNDER')
end)
Getting Current Weather from Another Script:
Citizen.CreateThread(function()
Wait(10000) -- Wait for 10 seconds
local currentWeather = exports['b2_weatherEssentials']:GetCurrentWeather()
print("Current Weather: " .. currentWeather)
end)
Download
Download B2 Weather Essentials
Join the Discussion
Have questions or feedback? Join the discussion below or on the Github Repo and connect with other server owners and developers.
Check Out My Other Resources
- B2_VehicleEssentials - A Free, Open Source Vehicle System.
- B2_NotifyV2 - A simple, sleek notification system.
- B2_Progressbars - A simple, sleek progressbar system.
Thank you for your support and I hope you enjoy using B2 Weather Essentials on your FiveM server.
Happy gaming!
B2