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

Violt

Server Resets game month every restart

Recommended Posts

Hey guys, 

I want my server to introduce Seasons. I noticed that the init.c resets the month to September the 20th every server restart. 

How do i make sure it doesn't reset so players experience different months thus temperatures?

 

    //DATE RESET AFTER ECONOMY INIT-------------------------
    int year, month, day, hour, minute;
    int reset_month = 9, reset_day = 20;
    GetGame().GetWorld().GetDate(year, month, day, hour, minute);

    if ((month == reset_month) && (day < reset_day))
    {
        GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
    }
    else
    {
        if ((month == reset_month + 1) && (day > reset_day))
        {
            GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
        }
        else
        {
            if ((month < reset_month) || (month > reset_month + 1))
            {
                GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
            }
        }
    }

Just remove that whole part? 

Edited by Violt

Share this post


Link to post
Share on other sites

Nevermind, 

Just edited a little. 

It now only makes sure the year is 2022 here's the new code: 

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_year = 2022;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

	if (year != reset_year)
	{
		GetGame().GetWorld().SetDate(reset_year, month, day, hour, minute);
		Print("[Seasons] Year has been reset");
	}
	else
	{
		Print("[Seasons] Year has not reset");
	}

 

Share this post


Link to post
Share on other sites

×