SA-MP Forums Archive
Static Weather - 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: Static Weather (/showthread.php?tid=461559)



Static Weather - eemalekorraks - 02.09.2013

Hello guys, currently I have enabled the clock on my server.

Код:
TogglePlayerClock(playerid, 1);
But every time I log in or respawn it forwards to random time, sometimes day sometimes night.

How would I make a static day, that everyone HAS DAY every time.


Helper will be repped.

Regards, Eemale


Re: Static Weather - iTorran - 02.09.2013

pawn Код:
forward updateTime();
public updateTime()
{
    SetWorldTime(12);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerTime(i, 12, 0);
        }
    }
    return 1;
}

//OnGameModeInit
SetTimer("updateTime", 60 * 1000, 1);
Change "60" in "60 * 1000" to how many minutes you want the time to update in


Re: Static Weather - Konstantinos - 02.09.2013

What is the point then to enable the clock if you want a stable time hour? It seems pointless to me.

Quote:
Note: Time will automatically advance 6 hours when the player dies.

Whenever a player spawns (after death), set their time (using SetPlayerTime) to 12.


Re: Static Weather - Dragonsaurus - 02.09.2013

Or set the whole server's time under OnGameModeInit.


Re: Static Weather - eemalekorraks - 02.09.2013

Thanks, issue resolved, however How would a /mutall and /unmute all command work? In ZCMD and sscanf2 or STRCMP, if you can also answer this question = +rep and my big thanks.

Regards, Eemale


Re: Static Weather - Konstantinos - 02.09.2013

I assume you have a /mute and /unmute command. If so, it's pretty much the same thing. Ignoring sscanf for the usage and other if statements and loop through all the players. Inside the loop, set them to mute (variable).