[FilterScript] Real-world weather in SA-MP!
#1

Firstly, this is conceptual. Although I did code it, I didn't code it as an interface. I'm simply showing off an idea!

What is this?
This is a filterscript that "synchronises" SA-MP ingame weather with real-world weather. You specify a location (any city or country should work) and it keeps weathers synchronised. If it's raining in the real world, it would rain ingame; if it's hot in the real world, it would be hot ingame too; if there's a sandstorm in the real world, there would be one ingame too!

How does it work?
The script sends an HTTP GET request to an API every few minutes, the JSON output is processed by my plugin, some math to decide the weather ID is done, and a SetWeather call sets the weather for all players.

What do I need?
My SAMPSON plugin: https://sampforum.blast.hk/showthread.php?tid=543919

Where can I find the files?
Source code: GitHub
Binary (AMX) file: Attached to post

How do I install it?
If you've downloaded the binary file, just place it inside your 'filterscripts' directory and add it to the 'server.cfg' settings file. Right now, it only works for London, UK and the refresh rate is 10 minutes. If you'd like to alter that, you're always free to download the source file and recompile it with your own settings!

Anybody to thank?
The SA-MP team for SA-MP itself
OpenWeatherMap for their wonderful API
Reply
#2

Woah, I've been waiting for someone to make a reallife.exe plugin for so long!
Reply
#3

I must say this is pretty cool.

Nice work
Reply
#4

Didn't somebody create one of these before? Not that i'm being horrible! Just remember seeing one, think Mauzen made it, didn't he?
Reply
#5

Interesting..
Reply
#6

Quote:
Originally Posted by Luis-
View Post
Didn't somebody create one of these before? Not that i'm being horrible! Just remember seeing one, think Mauzen made it, didn't he?
Yep, but it isnt working anymore as the weather website I used changed its layout and isnt working with the script anymore (I didnt use an API but parsed the website). Didnt find the time to update this yet, so this one is really useful, nice work
Reply
#7

Nice work
Reply
#8

very nice, Keep it Up.
Reply
#9

Quote:
Originally Posted by Luis-
View Post
Didn't somebody create one of these before? Not that i'm being horrible! Just remember seeing one, think Mauzen made it, didn't he?
I don't know about Mauzen's, but I just looked for others and the only one I found was too simple. This one chooses weather based on cloud density, atmosphere effects, rain/storm/fog/dust, and temperature. If the sky is clear but temperature is ~0c, the ingame weather would be dull as well; if the sky is clear but the temperature is ~25c, the ingame weather would be colourful and bright.
Reply
#10

Looks cool.. I'll test it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)