View Single Post
  #1  
Old 09-30-2012, 06:23 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default New Scripting Possibilities in Release candidate patch.

With the new patch its possible to get the Mission time.

Code:
double t = GamePlay.gpTimeofDay();
it's a double so you must convert it into time Format.
Code:
    static string CreateTimeString(double num)
    {
        double hours = Math.Floor(num); 
        double minutes = (num - hours) * 60.0; 
        double seconds = (minutes - Math.Floor(minutes)) * 60.0;  
        int H = (int)Math.Floor(hours);
        int M = (int)Math.Floor(minutes);
        int S = (int)Math.Floor(seconds);   
        return H.ToString() + ":" + M.ToString() + ":" + S.ToString(); 
    }

Also we get the possibility to set lables, but i had no luck to get it to work. So maybe others can give me a hint how to use it.
Reply With Quote