15.04.2014, 01:30
How to make a weather system which tells us the viibility wind speed sunny,cloudy,etc.
// Top of your script:
new weather;
// Under any callback (you need to store the weather in a variable so we can call it later):
weather = 1;
SetWeather(1);
// Stock (I got the descriptions from wiki.sa-mp.com/wiki/WeatherID)
stock GetWeather()
{
if(weather == 0)
{
SendClientMessageToAll(playerid, -1, "The weather is extra sunny!");
}
else if(weather == 1)
{
SendClientMessageToAll(playerid, -1, "The weather is sunny!!");
}
else if(weather == 2)
{
SendClientMessageToAll(playerid, -1, "The weather is extra sunny and smog!");
}
// etc etc
return 1;
}
#include streamer
new PlayerWeather[MAX_PLAYERS];
public OnPlayerEnterDynamicArea(playerid,areaid)
{
if(areaid == AREA_BONE_COUNTY)
{
PlayerWeather[playerid] = 1;
}
if(areaid == AREA_LAS_VENTURAS)
{
PlayerWeather[playerid] = 2;
}
SetPlayerWeather(playerid,PlayerWeather[playerid]);
}
stock GetWeather(playerid)
{
new weatherstr[15];
switch(PlayerWeather[playerid])
{
case 1: weatherstr = "Sandstorm";
case 2: weatherstr = "Heatwave";
}
return weatherstr;
}