Jump to content

Recommended Posts

Hi guys! How many ways you know to make a timer ?

Only using sleep; or maybe there is more ?

For example:

C4 TIMER: 30 seconds

Share this post


Link to post
Share on other sites

Purely for time delays, I used two options:

_Delay = 30;

// Example 1 - Sleep
Sleep _Delay;


// Example 2 - WaitUntil
_EndTime = time + _Delay;
WaitUntil {
	If ( Time > _EndTime ) exitWith { True };
	false;
};

Sleep is good if you only have result.
Waituntil is great if you need to be able to get out of the timer, such as the C4 being disarmed or destroyed.

Share this post


Link to post
Share on other sites

I used to know how to place a timer up on the screen. It would count down from (say) 30 seconds. It was found on forum that was closed. I kick myself for not writing it down.

Share this post


Link to post
Share on other sites

You can use this to convert into a mm:ss format too

MM_fnc_SecondsToClockFormat = {
	params ["_TimeInSeconds"];
	_mins = Round ((_TimeInSeconds/60) - 0.5); 
	_seconds = _TimeInSeconds - (_mins * 60);
	If (_mins < 10) then {_mins = format["0%1",_mins]};
	If (_seconds < 10) then {_seconds = format["0%1",_seconds]};
	_output = Format["%1:%2",_mins,_seconds];
	_output;
};

If you want an on screen counting timer, you can use a hint like above. Or you could create a RSC Display or use titles to position and customise it exactly to your liking. And could also tie that into an bar or that moves too.

 

MlULwy3.gif

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  

×