roguetrooper 2 Posted January 30, 2015 How would a script look like that informs a player (JIP and right from mission start) by hint (or globalchat or cuttext) how much time is left until the mission ends? (a message like "MISSION ENDS IN 41 MINUTES" when he joins the game). It should also be compatible to all daytimes of mission start and end. E.g. the mission starts at 0:30 and ends 01:30 the next (ingame) day. Been thinking about this every now and then for months but I just don't get it :-/ Share this post Link to post Share on other sites
Wolfenswan 1 Posted January 30, 2015 How would a script look like that informs a player (JIP and right from mission start) by hint (or globalchat or cuttext) how much time is left until the mission ends? (a message like "MISSION ENDS IN 41 MINUTES" when he joins the game).It should also be compatible to all daytimes of mission start and end. E.g. the mission starts at 0:30 and ends 01:30 the next (ingame) day. Been thinking about this every now and then for months but I just don't get it :-/ Just to be clear: when you say 45 minutes, do you mean real time or in-game time? Anyway, a very simple setup would be: [] spawn { waitUntil {time > 0} sleep 300; // Time in seconds for the "tick". cutText [format["%1 minutes have passed.",time/60],"PLAIN DOWN",2]; }; If you want the total time left, you need to define it as a global variable somewhere. If you want to use the in-game time, you can use the date command and check the hours/minutes. To get this working properly with JIP, you could just run most of the code on the server and use BIS_fnc_MP to broadcast the message. I wrote this script doing that for a mission of mine. It has a slightly different purpose but you should get the idea. Share this post Link to post Share on other sites
Lala14 135 Posted January 30, 2015 Is there a variable that you have already in place? If not what mission are you using? If not then you would have to define maybe in the description.ext what time the mission will end at and then you can add that to a variable and then use the daytime command or the date command So then you can use maybe like this in the init.sqf _missionendtime = 2.5; //0230 hours hint str(_missionendtime - daytime); OR you can use the serverTime variable which will let you tell you how much time the mission has been up for on the server. _missionammount = 45*60; //45mins hint str(_missionammount - serverTime); Share this post Link to post Share on other sites
Wolfenswan 1 Posted January 30, 2015 To clarify, you say: serverTime variable which will let you tell you how much time the mission has been up for on the server and the Wiki states: Note that in ArmA2 1.05 Final, this command only returns the time since the Server was actually started. Which to implies the total up-time, not time since mission was launched. Is the wiki wrong here ? Also, is bug mentioned by Crowe fixed in A3? Share this post Link to post Share on other sites
roguetrooper 2 Posted January 30, 2015 (edited) Thanks for the replies so far. The lobby parameters in my map allow to define the exact start time of my map (throughout the whole year). Definable variables are minute (0-55 in 5-min-steps), hour (0-23), day (1-31) and month (1-12). At the very beginning of the map the server sets the date with setDate [date select 0, _month, _day, _hour, _minute]; according to the lobby parameters. "_month" is "paramsArray select x" and so on. Further, the mission duration can be defined (also paramsArray select x) Known (and variable) values are: ingame start time and mission duration. It should be possible somehow to let a player know at any point of time how much minutes are left before the mission ends (e.g. ingame mission start time was 23:30, mission duration is 60 min, player joins at 23:49 ingame time, player should get message "mission ends in 41 minutes"). But as said, I just don't get it. Edited January 30, 2015 by RogueTrooper Share this post Link to post Share on other sites