SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 23/08/2010, 01:17 PM   #1
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 174
Reputation: 26
Post Weather streamer, update v1.2

This is my third release after the cruise control and the cb system. This filterscript allows you to set different weather to all parts of San Andreas (9 areas). The weather streams to player whenever they enter the area. Very simple and brings a lot to the game play. The FS sports 2 public functions that you can call from your gamemode:

Code:
stock SetAreaWeather(areaid, weatherid);
stock GetPlayerWeatherArea(playerid);
The first functions is the main function of the FS, it allows you to set weather in the chosen area. The second function is more for internal use of FS, but you may find use for it in your gamemode too.

There is also a callback:

Code:
OnPlayerEnterWeatherArea(playerid, areaid, weatherid);
It gets called whenever player enters new weather area. This callback may be a bit inaccurate, since FS checks for player position only once every 10 seconds - this is to prevent weather changing instantly when player balances on border of two areas. You don't need to use this callback, but if you want you can use it to inform player whenever they enter an area and tell them weather forecast like "Welcome to Whetstone, be careful there is heavy rain today". It doesn't matter what this callback returns.

The area ids are defined as follows:

Code:
#define WEATHER_AREA_NONE 0
#define WEATHER_AREA_LOS_SANTOS 1
#define WEATHER_AREA_LAS_VENTURAS 2
#define WEATHER_AREA_BONE_COUNTY 3
#define WEATHER_AREA_TIERRA_ROBADA 4
#define WEATHER_AREA_SAN_FIERRO 5
#define WEATHER_AREA_RED_COUNTY 6
#define WEATHER_AREA_FLINT_COUNTY 7
#define WEATHER_AREA_WHETSTONE 8
the WEATHER_AREA_NONE means player is outside San Andreas like on an island or in the sea. When player enters an interior, their weather is set to 0.

How to install:
* place WeatherStreamer.amx in your filterscripts folder
* Add WeatherStreamer to the filterscripts line in server.cfg
* place WeatherStreamer.inc in your pawno\include folder
* Put #include <WeatherStreamer> on top of your gamemode script

I recommend that you enable player clock in your GM - TogglePlayerClock(playerid, 1) to make weather changes smoother.

Example of use:
Code:
SetBoneCountyWeather(sandstorm)
{
	if (sandstorm) SetAreaWeather(WEATHER_AREA_BONE_COUNTY, 19);
	else SetAreaWeather(WEATHER_AREA_BONE_COUNTY, 1);
}
UPDATE 1.1: Fixed bug with Whetstone area not streaming in
UPDATE 1.2:
* Added public functions GetAreaWeather() and GetPlayerWeather()
* Changed default timer interval to 5000 ms
Attached Files
File Type: zip WeatherStreamer_v1.2.zip (2.7 KB, 696 views)

Last edited by mick88; 24/08/2010 at 03:07 PM.
mick88 is offline   Reply With Quote
Old 23/08/2010, 01:30 PM   #2
Brian_Furious
Gangsta
 
Brian_Furious's Avatar
 
Join Date: May 2009
Location: C:\Windows\System32\brian_furious.dll
Posts: 748
Reputation: 40
Default Re: Weather streamer

Incredible, i'll test it...it looks nice
__________________
I currently working on a NEW LA:RP (Los Angeles RolePlay) 3.0 R2
Brian_Furious is offline   Reply With Quote
Old 23/08/2010, 01:48 PM   #3
RealCop228
Godfather
 
Join Date: Feb 2010
Location: Springboro, OH
Posts: 8,265
Reputation: 670
Default Re: Weather streamer

Wow! Is this what's running on your server?
__________________
Putting [URGENT] in the thread title stops me from opening the thread. Nobody else's problem on this forum is more important that another person's. Try not to be self-centered!
RealCop228 is offline   Reply With Quote
Old 23/08/2010, 01:57 PM   #4
MisterTickle
Huge Clucker
 
MisterTickle's Avatar
 
Join Date: Jul 2007
Posts: 375
Reputation: 52
Default Re: Weather streamer

Now thats a very unique idea, Awesome.
__________________
MisterTickle is offline   Reply With Quote
Old 23/08/2010, 02:09 PM   #5
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 174
Reputation: 26
Default Re: Weather streamer

Quote:
Originally Posted by RealCop228 View Post
Wow! Is this what's running on your server?

Not yet, it will in next update. I need to finish testing it and define sets of weathers for each area.
mick88 is offline   Reply With Quote
Old 23/08/2010, 02:20 PM   #6
ScottCFR
Gangsta
 
Join Date: Nov 2009
Posts: 555
Reputation: 1
Default Re: Weather streamer

Wow, I didn't think this was possible. I'll have a look at your code to see how it works
__________________


ScottCFR is offline   Reply With Quote
Old 23/08/2010, 02:59 PM   #7
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: Durham, England
Posts: 2,232
Reputation: 63
Default Re: Weather streamer

wow, amazing!
WillyP is offline   Reply With Quote
Old 23/08/2010, 03:38 PM   #8
Dime
Huge Clucker
 
Join Date: Jul 2010
Posts: 277
Reputation: 1
Default Re: Weather streamer

Rly nice FS
Dime is offline   Reply With Quote
Old 23/08/2010, 04:13 PM   #9
DiddyBop
Gangsta
 
DiddyBop's Avatar
 
Join Date: Aug 2009
Posts: 705
Reputation: 10
Default Re: Weather streamer

More simple then i thought. Can't believe nobody made this before.

Useful for RP servers like a mofucka.
DiddyBop is offline   Reply With Quote
Old 23/08/2010, 05:11 PM   #10
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: Durham, England
Posts: 2,232
Reputation: 63
Default Re: Weather streamer

Quote:
Originally Posted by DiddyBop View Post
More simple then i thought. Can't believe nobody made this before.

Useful for RP servers like a mofucka.
offtopic: ure dp is shit D:
WillyP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] TSS - tAxI's Streamer Systems: full Streamer + HOUSING SYSTEM Utillity cptnsausage Includes 101 24/08/2012 12:05 AM
Need 3dtextlabel Streamer And Gangzone Streamer !! Please Help . Not streamer plugin . jame42 Scripting Help 4 30/05/2012 07:33 AM
[Include] [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! Yaheli_Faro Includes 46 20/04/2010 02:53 PM
Dominator's Object Streamer - a wize and new streamer - invisible objects fix tsha Filterscripts 23 19/09/2009 08:37 PM
About weather xploit101 Help Archive 5 09/09/2009 12:34 PM


All times are GMT. The time now is 09:44 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.