[FilterScript] [FS] Automatic Weather Changer
#1

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.)
Reply


Messages In This Thread
[FS] Automatic Weather Changer - by AG Adam - 21.09.2009, 12:45
Re: [FS] Automatic Weather Changer - by [XST]O_x - 21.09.2009, 12:48
Re: [FS] Automatic Weather Changer - by AG Adam - 21.09.2009, 12:55
Re: [FS] Automatic Weather Changer - by Roxan_Almighty - 21.09.2009, 13:05
Re: [FS] Automatic Weather Changer - by AG Adam - 21.09.2009, 13:11
Re: [FS] Automatic Weather Changer - by munnsie - 21.09.2009, 19:01
Re: [FS] Automatic Weather Changer - by AG Adam - 22.09.2009, 13:24
Re: [FS] Automatic Weather Changer - by Hammada12 - 11.10.2012, 07:10
Re: [FS] Automatic Weather Changer - by NoahF - 11.10.2012, 09:58
Re: [FS] Automatic Weather Changer - by Shadow19 - 14.10.2012, 07:07

Forum Jump:


Users browsing this thread: 2 Guest(s)