SA-MP Forums Archive
Freeze weather + time - 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: Freeze weather + time (/showthread.php?tid=320790)



Freeze weather + time - viddo - 24.02.2012

How can i make the weather freeze and doesnt change? i got a /weather [weather id] but it just changes it and then the weather changes again. Same with day/night thingie


Re: Freeze weather + time - Kaperstone - 24.02.2012

use timer.
under your "OnGameModeInit" put:
pawn Код:
SetTimer("ChangeWeatherBack",60000,1);
somwhere in your GM:
pawn Код:
forward ChangeWeatherBack()
public ChangeWeatherBack()
{
for(new i = 0; i < MAX_PLAYERS; i++) {
SetPlayerWeather(i,Weatherid);
}
}



Re: Freeze weather + time - viddo - 24.02.2012

Thanks, And for Day/Night ?


Re: Freeze weather + time - dice7 - 24.02.2012

Put this outside the loop
pawn Код:
SetWorldTime(12);//12:00
and this under OnPlayerConnect

pawn Код:
TogglePlayerClock(playerid, 0); // hide the clock



Re: Freeze weather + time - Kaperstone - 24.02.2012

Quote:
Originally Posted by viddo
Посмотреть сообщение
Thanks, And for Day/Night ?
just calculate.
Код:
1,000 = Second
60,000 = Minute
60,000 * 60 = 3,600,000 (1 hour)
3,600,000 * 24 = 86,400,000 (< Full day)
86,400,000 / 2 = 43,200,000 (< Half day)