hellstorm77 2 Posted March 4, 2014 I was wondering if someone could help me with a little script? What im trying to is active a trigger and on doing so a box appears with a count down timer Share this post Link to post Share on other sites
supergruntsb78 67 Posted March 4, 2014 perhaps you can take a look at these script files it has the timer you want implented in it defuse the bomb Share this post Link to post Share on other sites
cobra4v320 27 Posted March 4, 2014 [300] execVM "timer.sqf" timer.sqf private "_time"; _time = _this select 0; while {_time > 0} do { _time = _time - 1; hintSilent format["Time Left: \n %1", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring]; sleep 1; }; 2 1 Share this post Link to post Share on other sites
hellstorm77 2 Posted March 5, 2014 thanks cobra4v320 :) Share this post Link to post Share on other sites
hellstorm77 2 Posted March 5, 2014 the only problem i have, when i want to make it 1 hour and 30 mins ([5400] execVM "timer.sqf") the count down is in mins and second (89:59) not 1 hour 30 mins Share this post Link to post Share on other sites
scottdog62 9 Posted May 19, 2016 [300] execVM "timer.sqf" timer.sqf private "_time"; _time = _this select 0; while {_time > 0} do { _time = _time - 1; hintSilent format["Time Left: \n %1", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring]; sleep 1; }; Hey cobra been trying to get the timer to work, not sure where I put the time I want it to countdown from. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted May 19, 2016 Hey cobra been trying to get the timer to work, not sure where I put the time I want it to countdown from. Its just a script an u cann pass it to it: [your_start_time_here] execVM "timer.sqf" do urself a favor and read this: execVM Share this post Link to post Share on other sites
Obi Juan Kenobi 0 Posted March 31, 2018 Hello there, I can't figure it out, when I enter the [your_start_time_here] execVM "timer.sqf" in the trigger on activation, it say to me : type script, nothing exept. Could you help me? Share this post Link to post Share on other sites
Harzach 2517 Posted March 31, 2018 Have you created the timer.sqf script and placed it in the root of your mission folder? Share this post Link to post Share on other sites
Harzach 2517 Posted March 31, 2018 Have you replaced your_start_time_here with a number? 1 Share this post Link to post Share on other sites
Harzach 2517 Posted March 31, 2018 Oh, in the trigger's onAct, it should be: nul = [your_start_time_here] execVM "timer.sqf"; Share this post Link to post Share on other sites
Obi Juan Kenobi 0 Posted March 31, 2018 well thanks buddy! second time you help me out today! Share this post Link to post Share on other sites
Teuri 0 Posted March 15, 2019 On 3/4/2014 at 4:30 PM, cobra4v320 said: [300] execVM "timer.sqf" timer.sqf private "_time"; _time = _this select 0; while {_time > 0} do { _time = _time - 1; hintSilent format["Time Left: \n %1", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring]; sleep 1; }; Excellent contribution, it really helped me a lot. Now, how can I change the color of the numbers that are being discounted? and at the moment of finishing the count as I do so that the information of the counter is beliminated on the screen? Thank you Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted March 16, 2019 18 hours ago, Teuri said: Excellent contribution, it really helped me a lot. Now, how can I change the color of the numbers that are being discounted? and at the moment of finishing the count as I do so that the information of the counter is beliminated on the screen? Thank you For color you might use something like this: //function: TAG_fnc_coloredCountdownHint = { _color = "#45f442";//green _timeLeft = TAG_fnc_countdownEndTime - time; if (_timeLeft < 16) then {_color = "#eef441";};//yellow if (_timeLeft < 6) then {_color = "#ff0000";};//red if (_timeLeft < 0) exitWith { //exit and remove eventhandler while politely closing the door removeMissionEventhandler ["EachFrame",_thisEventHandler]; hintSilent parseText format ["<t color='%1'>--- Time is up! ---</t>",_color]; }; hintSilent parseText format ["Time Left:<br/><t color='%1'>--- %2 ---</t>", _color, [(_timeLeft/3600),"HH:MM:SS"] call BIS_fnc_timetostring]; }; //calling the function: _duration = 20; TAG_fnc_countdownEndTime = time + _duration; addMissionEventHandler ["EachFrame",{[] call TAG_fnc_coloredCountdownHint}]; Cheers 4 Share this post Link to post Share on other sites
Owling 1 Posted April 8, 2019 On 3/17/2019 at 1:17 AM, Grumpy Old Man said: For color you might use something like this: //function: TAG_fnc_coloredCountdownHint = { _color = "#45f442";//green _timeLeft = TAG_fnc_countdownEndTime - time; if (_timeLeft < 16) then {_color = "#eef441";};//yellow if (_timeLeft < 6) then {_color = "#ff0000";};//red if (_timeLeft < 0) exitWith { //exit and remove eventhandler while politely closing the door removeMissionEventhandler ["EachFrame",_thisEventHandler]; hintSilent parseText format ["<t color='%1'>--- Time is up! ---</t>",_color]; }; hintSilent parseText format ["Time Left:<br/><t color='%1'>--- %2 ---</t>", _color, [(_timeLeft/3600),"HH:MM:SS"] call BIS_fnc_timetostring]; }; //calling the function: _duration = 20; TAG_fnc_countdownEndTime = time + _duration; addMissionEventHandler ["EachFrame",{[] call TAG_fnc_coloredCountdownHint}]; Cheers Sorry to ask this I'm kind of noobish but how/where do I put this in. Also, if I want to have another trigger activate when the timer ends, how would I be able to do that. Will this works in a dedicate server ? Thanks in advance script wizards of BI forum. Share this post Link to post Share on other sites