[Include] MWeather - Improved and unique weather functions - Including weather zones and Real World Weather - alpha/test/preview
#1

Hi guys,
Im back with a - for me - unusual script. MWeather.
I got the idea of making this just a few days ago, from a post of a user in the forum here.

The major feature of the include is to get the real world's weather at any position and to set it on SAMP servers. This is done by samps HTTP function, a tiny php script on my webspace, and a weather website.
(Means: You can set the weather on your server to the current real weather of e.g. the town you live in)

1. Alpha
This is just a alpha version at the moment. It should already work without critical bugs. But besides further testing, I am releasing it at this moment, to get some feedback. I am planning to add some more features and improve the existing ones, but before doing this, i want to know, if there are some people being interested in the script. Else i would just waste my time, if I work on it and no one uses it
So tell me what you think, you can also post any further suggestions you have (from other weather types for real weather states to completely new features you would like to have. Feel free to suggest everything that has something to do with weather)

2. Installation
Copy the pastebin code, create an empty file with pawno or any other editor and paste the code. Then save the file as 'MWeather.inc' in your pawno/include/ folder.
Add #include <MWeather>
to the other includes of your gamemode, and put
MWeather_OnGameModeInit();
somewhere in your OnGameModeInit

Done! You can now use all the functions MWeather provides.

3. Functions
I had two major features in mind when I started creating the script: Getting the real weather in samp, and creating moveable weather zones. Both are working in the alpha version.
I wont explain all the functions here in the forum, becuase it looks ugly with all the text.
So I created a wiki page, that i will update with future versions of the include.

https://sampwiki.blast.hk/wiki/Mweather

It might be a bit hard to understand at first, because my weather/observer system can be quite confusing, so also feel free to ask questions about how to use this


4. ToDo
As mentioned before, if there are enough people liking this, I will go on with the developement, as I do with all my scripts.
Some of the things I plan to do in the next time: (If you send some suggestions, they might get on the list, too)
(1: low priority, 10: highest priority)

- (4) Optimize the weather ids for the specific real weather states: Some weathers do not fit really well atm.
- (5) Improve zone movement: The movement speed is just a temporary solution, because it is not m/s atm
- (7) Fix zone-in-zone behaviour: If there are two or more zones crossing, the weather is buggy.
- (1) Optimize the code: It is alpha code, very inefficient and untidy. Makes no sense to clean this before planned thigns are added

5. Other infos
My default ©:
You are allowed to use this include in your script.
You are allowed to change the code for private use.
You are not allowed to re-release this script without my permission

If you use this include, it would be nice to give me some credits
in any way. But you do not have to, because I cannot check it
anyways.

6. Files
Pastebin alpha #2
Filter PHP script


Have fun and dont forget to leave some feedback or feature suggestions!

PS: Yes, i love to edit my posts thousands of times
Reply
#2

Looks nice, GJ!
Reply
#3

very good!
Reply
#4

Nice job, very unique.

However it's not needed to create a WIKI page, since if every script creator did that, the wiki would be flooded. Also because the code on these forums looks good enough.
Reply
#5

A weather system that actually finds weather in a location!
Reply
#6

Thanks for the comments
But unfortunately it seems as there is not much interest for such functions. So i think I will go back to my gm instead of improving this.

@Grim: Maybe you are right, but the wiki is open, and for scripting stuff, so why not add functions of other includes to it? If all name them correctly, there will be no problems with too many pages or wrong search results
Reply
#7

amazing, please continue working on it!, its very useful for roleplay servers
Reply
#8

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
But unfortunately it seems as there is not much interest for such functions. So i think I will go back to my gm instead of improving this.
I don't think people realize how much of an awesome system this is. Please DO improve it!
Reply
#9

lol.. this is awesome.
Reply
#10

This is crazy...Its really good.
Nice job!
Reply
#11

damn awesome include look at this exemple:
pawn Код:
//This example creates a weather observer for Chicago
//and sets it as global weather
public OnGameModeInit()
{
    new chicago = AddWeatherObserver("http://weather.yahoo.com/united-states/illinois/chicago-2379574/", 900000);
    SetRealWeatherEx(chicago);
}
this is awesome, good job
Reply
#12

Quote:
Originally Posted by Seven.
Посмотреть сообщение
lol.. this is awesome.
Quote:
Originally Posted by notime
Посмотреть сообщение
This is crazy...Its really good.
Nice job!
Quote:
Originally Posted by Brian_Furious
Посмотреть сообщение
damn awesome include look at this exemple:
pawn Код:
//This example creates a weather observer for Chicago
//and sets it as global weather
public OnGameModeInit()
{
    new chicago = AddWeatherObserver("http://weather.yahoo.com/united-states/illinois/chicago-2379574/", 900000);
    SetRealWeatherEx(chicago);
}
this is awesome, good job
You see, "Mauzen"? You got to have faith!
Reply
#13

Hehe, thanks.

Ok, maybe I will reconsider it and continue working on this.
Damn, Ive got lots of nice scripts to improve and to finish, but just too little time
Reply
#14

awesome great work
Reply
#15

not work with me
i put
PHP код:
MWeather_OnGameModeInit(); 
in public GameModeInit(); but not working
i tried put
PHP код:
new chicago AddWeatherObserver("http://weather.yahoo.com/united-states/illinois/chicago-2379574/"900000);
    
SetRealWeatherEx(chicago); 
Reply
#16

Quote:
Originally Posted by oOegyptOo
Посмотреть сообщение
not work with me
i put
PHP код:
MWeather_OnGameModeInit(); 
in public GameModeInit(); but not working
i tried put
PHP код:
new chicago AddWeatherObserver("http://weather.yahoo.com/united-states/illinois/chicago-2379574/"900000);
    
SetRealWeatherEx(chicago); 
Does it give you any error messages when compiling or does it just not change the weather?
If it is the second, check if your firewall allows the http connection for samp (should be port 80 i think)
Maybe the weather was just the same as you already had on your server.
Reply
#17

can you give me your php code to check the weather? thx
Reply
#18

very nice job.
Reply
#19

MWeather_OnGameModeInit();
sanfrancisco = AddWeatherObserver("http://weather.yahoo.com/ukraine/cherkasy-oblast/uman-936812/",300000);
SetRealWeatherEx(sanfrancisco);
printf(" Weather: %d",GetRealWeatherEx());

does not work
Reply
#20

Brilliant, just What I was looking for
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)