03.11.2014, 18:59
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
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