After 9 PM weather change
#1

How i can make a script wich i can change after 9 PM to evening weather?
Reply
#2

Do you use a script for server time ?

Код:
static Minute, Second;
etc.
Reply
#3

No, i didn't use any scripts for server time.
Reply
#4

Copy this top of the script.

Код:
static Minute, Second;
forward SecondTimer();
Add this under OnGameModeInit()

Код:
SetTimer("SecondTimer", 1000, 1);
Copy this script bottom of the script.

Код:
public SecondTimer()
{
	Second++;
	if(Second == 60)
	{
	    Second = 0;
	    Minute++;
	    if(Minute == 21) // It's 9 PM
	    {
	        SetWeather(3); // Your weather ID
	    }
	    if(Minute == 24)
	    {
	        Minute = 0;
	    }
	}
	return 1;
}
This under OnPlayerStateChange()

Код:
SetPlayerTime(playerid, Minute, Second);
Visit http://weedarr.wikidot.com/weather for a list of weather IDs with pictures!
Reply
#5

Thanks dude
Reply
#6

No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)