Weather/Time
#1

Hello, i know it's kind of a silly question, but i have clock and date, and it works fine.
But the weather never changes, i want it to change automatically with the time.

+1 rep for helpers!
Reply
#2

pawn Код:
public SyncTime()
{
    new tmphour;
    new tmpminute;
    new tmpsecond;
    gettime(tmphour, tmpminute, tmpsecond);
    FixHour(tmphour);
    tmphour = shifthour;
    if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
    {
        ghour = tmphour;
        foreach(Player, i)
        {
            PayDayAuth[i] = 1;

        }
        if (realtime)
        {
            SetWorldTime(tmphour);
        }
        new RandomWeth;
        RandomWeth = random(3);
        switch(RandomWeth)
        {
            case 0:
            {
                DefaultWeather = 0;
                SetWeather(DefaultWeather);
            }
            case 1:
            {
                DefaultWeather = 11;
                SetWeather(DefaultWeather);
            }
            case 2:
            {
                DefaultWeather = 7;
                SetWeather(DefaultWeather);
            }
        }
    }
}
That's the code I use for my hours and weather changes.
Reply
#3

When you have the time change, simply add a random variable and SetWeather(weatherid); to change the weather for all players.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)