MIST getDHMS: Difference between revisions

From DCS World Wiki - Hoggitworld.com
Created page with "{{Mission Scripting |fName= mist.time.getDHMS |vNum = Mist 3.7 |desc= Returns a table formatted as {d = day, h = hours, m = minutes, s = seconds} of a given time in seconds..."
 
No edit summary
 
Line 5: Line 5:
|vNum = Mist 3.7
|vNum = Mist 3.7


|desc= Returns a table formatted as {d = day, h = hours, m = minutes, s = seconds} of a given time in seconds. If no value is passed the function returns the current time of the mission.  
|desc= Returns a table formatted as {d = day, h = hours, m = minutes, s = seconds} of a given time in seconds. If no value is passed the function logs an error and returns nil.  


|rtnType= table
|rtnType= table
Line 57: Line 57:


<code>
<code>
   local date = mist.time.getDHMS()
   local date = mist.time.getDHMS(timer.getAbsTime())
   if date.h >= 21 or date.h =< 5 then
   if date.h >= 21 or date.h =< 5 then
     lightBombs = true
     lightBombs = true

Latest revision as of 15:52, 4 January 2019


mist.time.getDHMS

Added with: Mist 3.7
Description
Returns a table formatted as {d = day, h = hours, m = minutes, s = seconds} of a given time in seconds. If no value is passed the function logs an error and returns nil.
Syntax
table mist.time.getDHMS( number time )
Valid Input Values:
93600
Return value:
table
Return example:
{d = 2, h = 2, m = 0, s = 0}
Usage Examples:
The following example would be an approximate function to determine the use of illumination flares or bombs.

 local date = mist.time.getDHMS(timer.getAbsTime())
 if date.h >= 21 or date.h =< 5 then
   lightBombs = true
 end

Notes:
Related Functions
getDate, getDHMS, convertToSec, milToGame

Scripting Engine

MIST Root Page