Author: BlenderRus
Author Website:

Requirements: No addons required

Version: 1.0

Short description: A small extension for ArmA 2 which can get system date & time, and count time in seconds between specific calls using windows system date & time.

Date: 2013-01-16 08:16


Comments: (1)
Rating:



 



Get System Date & Time / External Time Counter

by
BlenderRus


Description:
Because ArmA's "sleep" command isnt working proper in multiplayer (for example: "sleep 600;" on a server can actually "be" 800 seconds or even more on overloaded servers) - I wrote this small extension for ArmA 2 which can get system date & time, and count time in seconds between specific calls using windows system date & time.
This will be useful for example: for multiplayer mission makers to start some side-missions every 10 minutes...


Installation / Usage:
Just put blend-time.dll inside any of your server addons folder or create one (i.e. <Arma 2 Folder>\@time\blend-time.dll).

To get current date and time:
_dateTime = "blend-time" callExtension "date";
This will return an array:
["date", <DAY>, <MONTH>, <YEAR>, <HOUR>, <MINUTE>, <SECOND>];
for example:
["date", 19, 12, 2012, 04, 21, 09];
This means: 19 of December 2012 04:21:09

To start time count use:
_startCount = "blend-time" callExtension "set";
If everything is ok the answer will be:
["set", 0];

To show how much seconds elapsed after "set" call:
_timeElapsed = "blend-time" callExtension "check";
If everything is OK and timer was started with "set" call - this will return an array:
["check", <ELAPSED TIME IN SECONDS>];
To start a new time count call "blend-time" callExtension "set"; again.
All call arguments are case sensitive!


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Clock,   System,   Time