Static Weather
#1

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
Reply
#2

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
Reply
#3

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.
Reply
#4

Or set the whole server's time under OnGameModeInit.
Reply
#5

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
Reply
#6

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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)