Jump to content
Sign in to follow this  
CaptainBravo

Skip time only between certain hours

Recommended Posts

I have seen and tested a few skip time scripts, they are not exactly what I am looking for. I am looking to skip time 1 hour every 5 minutes between 6pm 6am after that script ends. Tried with triggers to start and end script with no luck. I was wondering if there is a simple clean script to achieve this?

Thanks for your help.

Share this post


Link to post
Share on other sites
while {true} do 
{
 if ((daytime > 6) and (daytime < 18)) then { skipTime 1; };
 sleep (5 * 60);
};

Thanks Przemek_kondor, can this be activated from trigger or needs to be in script format?

Share this post


Link to post
Share on other sites

IIR "sleep" doesn't work in triggers so using execVM is required.

But maybe this trick would work in trigger:

temp = [] spawn {while {true} do {if ((daytime > 6) and (daytime < 18)) then { skipTime 1; }; sleep (5 * 60); };};

Share this post


Link to post
Share on other sites
IIR "sleep" doesn't work in triggers so using execVM is required.

But maybe this trick would work in trigger:

temp = [] spawn {while {true} do {if ((daytime > 6) and (daytime < 18)) then { skipTime 1; }; sleep (5 * 60); };};

I have tried the trigger and for some reason did not work.

So I have tried executing script in init.sqf with execVM "skiptime.sqf"; but still no luck. now I have >18 and <6 as it is supposed to kick in once evening comes. So I am not sure what I have missed here?

skiptime.sqf:

while {true} do

{

if ((daytime > 18) and (daytime < 6)) then { skipTime 1; };

sleep (5 * 60);

};

Share this post


Link to post
Share on other sites

Remember all that needs to run on all clients since it's local. Also skiptime isn't broadcast to JIP players like date is.

Share this post


Link to post
Share on other sites
Remember all that needs to run on all clients since it's local. Also skiptime isn't broadcast to JIP players like date is.

@Przemek_kondor for some reason it is not working. Is execVM "skiptime.sqf"; the right way to excute script in init.sqf?

@kylania I thought with patch 1.6 JIP got skiptime update right away and everyone else got it after 30 seconds?

Share this post


Link to post
Share on other sites

(daytime > 18) and (daytime < 6)

But such condition will never become true. Value can't be in the same moment bigger than 18 AND smaller than 6.

Use this instead:

if ((daytime > 18) OR (daytime < 6)) then {skipTime 1};

Share this post


Link to post
Share on other sites
But such condition will never become true. Value can't be in the same moment bigger than 18 AND smaller than 6.

Use this instead:

if ((daytime > 18) OR (daytime < 6)) then {skipTime 1};

Thanks Rydygier, works perfect now thanks.:don 11:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×