Release HH:MM:SS to Seconds Function

Discussion in 'Call of Duty Classics' started by vRice, Aug 20, 2017.

  1. vRice

    vRice Known Member

    55
    94
    118
    Credits:
    670
    Another quick release for you guys, basically if you want a loop to wait for a certain amount of time and you don't wanna convert it to seconds yourself you can use this bad boi.

    Here's the code:
    Code:
    hmsConvert(time)
    {
        array = strTok(time, ":");
        return int((int(array[0]) * 60 * 60) + (int(array[1]) * 60) + int(array[2]));
    }
    
    Call it like so:
    Code:
    exampleLoop()
    {
        while(true)
        {
            self iPrintLn("Howdy");
            wait hmsConvert("00:05:00"); //Hours, Minutes, Seconds
        }
    }
    
    
     
    Last edited: Sep 11, 2017

Share This Page