Jump to content
Sign in to follow this  
dimdic

How can i put a timer in the mission?? (time limit in order to complete it)

Recommended Posts

How can i put a timer for the mission to be completed ?? For example 30 minutes.. i want the countdown to be visible while playing the game! And when the 30 minutes are passed i want the mission to fail. Thank you.

Share this post


Link to post
Share on other sites

http://forums.bistudio.com/showpost.php?p=2087148&postcount=2

remake to what you need:

// place in your time available.
_hour = 0;
_minute = 30;
_second =  0;

while {true} do {
if (_second == 0 AND (_minute > 0 OR _hour > 0)) then {
	_second = 59;
	if (_minute > 0) then {
		_minute = _minute - 1;
	} else {
		if (_hour > 0) then {
			_hour = _hour - 1;
			_minute = 59;
		};
	};
} else {
	_second = _second - 1;
};
hintSilent format["Timeleft = %1 : %2 : %3",_hour, _minute,_second];
sleep 1;
if (_hour == 0 and _minute == 0 and _second == 0) exitWith {endMission "LOSER"};
};

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  

×