Yup it's broken: http://fougerite.com/threads/fougerite-mc.148/page-3#post-1630*Always day;
I know Rust++ has Freeze_Time setting but i think its broken. (@mikec will know)
*item condition;
Go to Root/Server_data and open server.cfg.
and paste this into it.
0 = off, 1 = default. 0.5 = half, etc.Code:conditionloss.damagemultiplier 0 conditionloss.armorhealthmult 0
Its possible to set to noon every 1 min by using timers.So there is no way to do it yet?
function DayTimeCallback(){
World.Time = 12; //Set time to 12 (Noon)
}
function On_PluginInit() {
Plugin.CreateTimer("DayTime", 60000).Start(); //60,000 = 1 min.
}
That's ms... 1000 = 1sec, 60000 =1minIts possible to set to noon every 1 min by using timers.
JavaScript:function DayTimeCallback(){ World.Time = 12; //Set time to 12 (Noon) } function On_PluginInit() { Plugin.CreateTimer("DayTime", 1000).Start(); //10,000 = About 1 min. }
function On_PluginInit() {
try{
while(World.Time != 12){
World.Time = 12;
}
}catch(err){Plugin.Log("Error", "Something Broke! --> " + err.message);}
}
Don't do it !Could the dangerous "while" be used? (Dangerous for me)
I always use try now, learned my lesson.JavaScript:function On_PluginInit() { try{ while(World.Time != 12){ World.Time = 12; } }catch(err){Plugin.Log("Error", "Something Broke! --> " + err.message);} }![]()
Don't do it !
Never ever use a wile loop when you arn't sure that it will stop or have a delay in it
Here I'm not sure of what it will do, two options :
- Run once and then go out of the wile loop not resetting the time anymore
- Keep running again and again cause the time have the time to update just after you set it and before it checks, this will lag your server
You should use a timer![]()
World w = World.GetWorld();
w.DayLength = float.MaxValue;
w.Time = 12;
World.DayLength = Number.MAX_VALUE;
World.Time = 12;
function On_PluginInit(){
Plugin.CreateTimer("Time", 60000).Start();
}
function TimeCallback(){
Plugin.KillTimer("Time");
World.DayLength = Number.MAX_VALUE;
World.Time = 12;
Plugin.CreateTimer("Time", 60000).Start();
}