[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


Messages In This Thread
Real-world weather in SA-MP! - by KingHual - 03.11.2014, 18:59
Re: Real-world weather in SA-MP! - by Drebin - 03.11.2014, 19:01
Re: Real-world weather in SA-MP! - by Smileys - 03.11.2014, 19:31
Re: Real-world weather in SA-MP! - by Luis- - 03.11.2014, 20:09
Re: Real-world weather in SA-MP! - by Gogorakis - 03.11.2014, 23:56
Re: Real-world weather in SA-MP! - by Mauzen - 04.11.2014, 00:08
Re: Real-world weather in SA-MP! - by Team_PRO - 04.11.2014, 00:23
Re: Real-world weather in SA-MP! - by Rudy_ - 04.11.2014, 06:04
Re: Real-world weather in SA-MP! - by KingHual - 04.11.2014, 08:17
Re: Real-world weather in SA-MP! - by MafiaZ - 09.11.2014, 02:06

Forum Jump:


Users browsing this thread: 1 Guest(s)