SA-MP Forums Archive
[FilterScript] [FS] Automatic Weather Changer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] Automatic Weather Changer (/showthread.php?tid=98532)



[FS] Automatic Weather Changer - AG Adam - 21.09.2009

Hi!

Today I making a filterscript for my server. This is changing the weather by user defined interval.
At starting this interval is 5 minutes.
You can write the time in Seconds or Milliseconds
If you want to write in Miliseconds, change this in the script:

pawn Code:
#define TIME_SECOND // Comment it (write two '/' to the front of this line)
How to use?

1. Download
2. Put it into your Filterscript folder
3. Write to the filterscripts line in Server.cfg: w-changer.
4. Play the game!


Download link:

1.0 - PWN File
1.0 - AMX File

1.1 - PWN File
1.1 - AMX File

Changes in 1.1:

Changed the define system's format.

In 1.0:
pawn Code:
//------------------------------------------------------------------------------
//This is the weather changer's interval (how often change the weather)

#define TIME_SECOND // If you defined this, it means you give the interval in SECONDS, not MILISECONDS.
// #define TIME_MILISEC // If you defined this, it means you give the interval in MILISECONDS, not SECONDS.

#define wtime 5 // If you defined TIME_SECOND, you have to put this interval in SECONDS, not MILISECONDS.

//This is the weather changer's interval (how often change the weather)
//------------------------------------------------------------------------------
//
// More lines after...
//
//
public WeatherChanger()
{
SendRconCommand("weather 0");
#if defined TIME_MILISEC
SetTimer("Weather3",wtime,0);
#endif
#if defined TIME_SECOND
SetTimer("Weather3",wtime*1000,0);
#endif
return 1;
}
See the 'If Defined' lines!
Now see these lines in 1.1, and see the defines:
pawn Code:
//------------------------------------------------------------------------------
//This is the weather changer's interval (how often change the weather)

#define TIME_SECOND // If you defined this, it means you give the interval in SECONDS, not MILLISECONDS.

#define wtime 300 // If you defined TIME_SECOND, you have to put this interval in SECONDS, not MILLISECONDS.

//This is the weather changer's interval (how often change the weather)
//------------------------------------------------------------------------------
//
//
// More lines after...
//
//
public WeatherChanger()
{
SendRconCommand("weather 0");
#if defined TIME_SECOND
SetTimer("Weather3",wtime*1000,0);
#else
SetTimer("Weather3",wtime,0);
#endif
return 1;
}
You need to see this lines in 1.0:
Quote:

//------------------------------------------------------------------------------
//This is the weather changer's interval (how often change the weather)

#define TIME_SECOND // If you defined this, it means you give the interval in SECONDS, not MILISECONDS.
// #define TIME_MILISEC // If you defined this, it means you give the interval in MILISECONDS, not SECONDS.

#define wtime 5 // If you defined TIME_SECOND, you have to put this interval in SECONDS, not MILISECONDS.

//This is the weather changer's interval (how often change the weather)
//------------------------------------------------------------------------------

More lines after...

#if defined TIME_MILISEC
SetTimer("Weather3",wtime,0);
#endif
#if defined TIME_SECOND
SetTimer("Weather3",wtime*1000,0);
#endif

And in 1.1:
Quote:

//------------------------------------------------------------------------------
//This is the weather changer's interval (how often change the weather)

#define TIME_SECOND // If you defined this, it means you give the interval in SECONDS, not MILLISECONDS.

#define wtime 300 // If you defined TIME_SECOND, you have to put this interval in SECONDS, not MILLISECONDS.

//This is the weather changer's interval (how often change the weather)
//------------------------------------------------------------------------------

More lines after...

#if defined TIME_SECOND
SetTimer("Weather3",wtime*1000,0);
#else
SetTimer("Weather3",wtime,0);
#endif

If you don't see the changes, you are stupid .
Bugs:
No bugs founded. If you find one please post!



Sorry for my English, that is not brilliant because I am Hungarian. (But I try to speak good and don't drop any language mistakes.)


Re: [FS] Automatic Weather Changer - [XST]O_x - 21.09.2009

Very nice


Re: [FS] Automatic Weather Changer - AG Adam - 21.09.2009

Quote:
Originally Posted by 3xPloSioNxXx
Very nice
Thanks


Re: [FS] Automatic Weather Changer - Roxan_Almighty - 21.09.2009

this would be really good for RP server's! Well done!


Re: [FS] Automatic Weather Changer - AG Adam - 21.09.2009

Quote:
Originally Posted by Roxan_Almighty
this would be really good for RP server's! Well done!
Thanks! I translated a sentence because I don't know how to write it in English.

I would not have believed it that a man likes this much what I did.

I want to say something like this:
I don't know before relasing this FS, how many people like it, and I posted it before 5 minutes.


Re: [FS] Automatic Weather Changer - munnsie - 21.09.2009

one problem...
you spelt milliseconds wrong.
you put one 'l' should be 2


Re: [FS] Automatic Weather Changer - AG Adam - 22.09.2009

Okay, thanks, changed.

EDIT: And 1.1 is here.


Re: [FS] Automatic Weather Changer - Hammada12 - 11.10.2012

wow its cool thx for it


Re: [FS] Automatic Weather Changer - NoahF - 11.10.2012

Nice work! Very useful for RP/CnR servers!


Re: [FS] Automatic Weather Changer - Shadow19 - 14.10.2012

There is no DL link...