Custom Ingame Server Time
You can keep the time of day on your DayZ server in a set range of hours. Some owners want daylight all the time, and others want it always dark.
Installation
- Stop the server by clicking STOP on the Game Server page in the Command Center.
- Log in with an FTP program (FileZilla). How to connect: FTP Access.
- Open the /MPmissions/dayzOffline.chernarusplus folder. On Livonia it's dayzOffline.enoch, on Frostline dayzOffline.sakhal and on Badlands dayzOffline.nasdara. Use your map's folder name in the later steps too.
- Download Capps' Custom DayZ SA Time: get the "Scripts" folder from GitHub.
- Extract the "Scripts" folder into your MPMissions\dayzOffline.chernarusplus folder.
- Open your Init.c file
- At the top of the Init.c file, add these lines right before void main():
- To set the hours, change setStartHour and setStopHour. 0 is 12:00am and 23 is 11:00pm.
- At the very bottom of void main(), add this line:
- Scroll down to right after override void StartingEquipSetup(PlayerBase player, bool clothesChosen) inside class CustomMission: MissionServer:.
- Add this code there:
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\Scripts\\cappsTimeLoop.c" int setStartHour = 10; int setStopHour = 16;
cappsTimeLoop(setStartHour,setStopHour,true);
override void TickScheduler (float timeSplice)
{
GetGame().GetWorld().GetPlayerList(m_Players);
if( m_Players.Count() == 0 ) return;
for(int i = 0; i < SCHEDULER_PLAYERS_PER_TICK; i++)
{
if(m_currentPlayer >= m_Players.Count() )
{
m_currentPlayer = 0;
}
PlayerBase currentPlayer = PlayerBase.Cast(m_Players.Get(m_currentPlayer));
currentPlayer.OnTick();
m_currentPlayer++;
}
//Ignore above code that is required to keep food,drink and other survival elements working
int currentTime = GetGame().GetTime() * 0.001;
static int newTime = 0;
int timeDelay = 180;
if (currentTime >= newTime + timeDelay)
{
//GetGame().ChatPlayer(1,"3 minute check on reset!");//for debug pruposes
cappsTimeLoop(setStartHour,setStopHour,false);
//GetGame().ChatPlayer(1,"Passed the time switch call");//for debug pruposes
newTime = currentTime;
}
}
Rent a DayZ server from Survival Servers with instant setup.