23.08.2010, 13:17
(
Последний раз редактировалось mick88; 24.08.2010 в 15:07.
)
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:
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:
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:
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:
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
Код:
stock SetAreaWeather(areaid, weatherid); stock GetPlayerWeatherArea(playerid);
There is also a callback:
Код:
OnPlayerEnterWeatherArea(playerid, areaid, weatherid);
The area ids are defined as follows:
Код:
#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
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:
Код:
SetBoneCountyWeather(sandstorm) { if (sandstorm) SetAreaWeather(WEATHER_AREA_BONE_COUNTY, 19); else SetAreaWeather(WEATHER_AREA_BONE_COUNTY, 1); }
UPDATE 1.2:
* Added public functions GetAreaWeather() and GetPlayerWeather()
* Changed default timer interval to 5000 ms