Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
TisCollier

Server Time

Recommended Posts

I can't seem to get a custom time running on my server using

serverTime="2015/4/8/17/23"; 

It does not seem to set the custom time just continues with System Time.

Share this post


Link to post
Share on other sites

It's a common issue every server is having right now.

 

This fix is supposed to skip skip night, so when it's 8PM the server will set ti's time to 7AM:


 

1. Open Mpmissions - dayzOffline.chernarusplus - init.c
2. At the top add:

#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\Correct_InGame_time.c"

3. under the line: weather.SetWindFunctionParams

add: GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(Correct_InGame_time, 1000, true);

4. Create a file manually with the name "Correct_InGame_time.c" and fill it with the following text:

static void Correct_InGame_time()
{
    private int year, month, day, hour, minute;
    GetGame().GetWorld().GetDate( year, month, day, hour, minute );
    
    if ((hour < 7) || (hour >= 20))
    {
        if (hour < 7)
        {
            GetGame().GetWorld().SetDate(year, month, day, 7, 3);
        }
        if (hour >= 20)
        {
            GetGame().GetWorld().SetDate(year, month, (day + 1), 7, 3);
        }
    }
}

 

Share this post


Link to post
Share on other sites

I simply added    GetGame().GetWorld().SetDate(2018, 6, 12, 7, 3); in the init.c file immediately after the weather settings and it seems to be working so far.  I tried all the other fixes and they worked for a few restarts then the server was dark again.   This keeps the server at a set time until the Dev's fix the issue.

Share this post


Link to post
Share on other sites
54 minutes ago, Emazeg said:

I simply added    GetGame().GetWorld().SetDate(2018, 6, 12, 7, 3); in the init.c file immediately after the weather settings and it seems to be working so far.  I tried all the other fixes and they worked for a few restarts then the server was dark again.   This keeps the server at a set time until the Dev's fix the issue.

Working for me so far.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×