Jump to content
Sign in to follow this  
BlenderRUS

[ArmA 2] Get System Date & Time / External Time Counter

Recommended Posts

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...

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!

Author: Blender

Download:

- ARMA3.RU FTP

- ARMA3.RU HTTP

Edited by BlenderRus
Fixed download urls

Share this post


Link to post
Share on other sites

Hey Blender i hope you can help me!

Your blend-time.dll works like it should but is there a possibility to get, on a "blend-time" callExtension "check"; the milliseconds also?

so i get a output like

["check",2.342]

If you still have the sourcecode, would you mind sharing it so i can add the function into it?

Or if you have the time to do a quick modification, i would really appreciate it!

Thanks for your time,

Otter

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  

×