24.04.2009, 22:51
I set a weather for one player, but how can i get the weather on the Server again? and set for the player?
new ServerWeather; //At the top
//When you set the weather
SetWeather(2); //For example 2
ServerWeather = 2;
//When you change the player's weather back
SetPlayerWeather(playerid,ServerWeather);

forward SetWeatherEx(weatherid);
forward GetWeather();
new CurrentWeather;
public SetWeatherEx(weatherid)
{
SetWeather(weatherid);
CurrentWeather = weatherid;
}
public GetWeather()
{
return CurrentWeather;
}

forward SetPlayerWeatherEx(playerid, weatherid);
forward GetPlayerWeather(playerid);
new CurrentWeather[MAX_PLAYERS];
public SetPlayerWeatherEx(playerid, weatherid)
{
SetPlayerWeather(playerid, weatherid);
CurrentWeather[playerid] = weatherid;
}
public GetPlayerWeather(playerid)
{
return CurrentWeather[playerid];
}