SA-MP Forums Archive
Question about SetWeather - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question about SetWeather (/showthread.php?tid=353813)



Question about SetWeather - Dodo9655 - 24.06.2012

Let's say there's 2 players online, if I use SetWeather the weather changes for the two players, right?
But if more players connect will their weather be set to the same ID that has been used in SetWeather?
Or do I have to use SetPlayerWeather everytime someone connects?


Re: Question about SetWeather - iGetty - 24.06.2012

Easy; just do:

pawn Код:
new Weather;

forward WeatherChange();

public OnGameModeInit()
{
    Weather = 1;
    SetWeather(Weather);
    SetTimer("WeatherChange", 30000, 1);//Every 30 seconds
    return 1;
}

public WeatherChange()
{
    new rand = 0 + random(17);
    Weather = rand;
    SetWeather(Weather);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetPlayerWeather(playerid, Weather);
    return 1;
}
There you go, that's making it all good.


Re: Question about SetWeather - Dodo9655 - 24.06.2012

Thanks.


Re: Question about SetWeather - Grand_Micha - 24.06.2012

Pff. If you want it to be the same for everybody...Just use SetWeater(weatherid);