interface l_timer {
    getAbsTime(): number;
    getPause(...args: any[]): unknown;
    getTime(): number;
    getTime0(): number;
    removeFunction(functionId: number): void;
    scheduleFunction(
        functionToCall: Function,
        anyFunctionArguement: any[],
        modelTime: number,
    ): number;
    setFunctionTime(functionId: number, modelTime: number): void;
}

Hierarchy (View Summary)

Methods

  • Returns the game world time in seconds relative to time the mission started. Will always count up from when the mission started. If the value is above 86400 then it is the next day after the mission started. This function is useful in attaining the time of day.

    Assuming a mission started at noon the value returned would be 43200. (126060). Midnight would be 0. Calling this function at 12:00:10 timer.getAbsTime will return 43210.xxx.

    Returns number

  • Schedules a function to run at a time in the future. This is a very powerful function. The function that is called is expected to return nil or a number which will indicate the next time the function will be rescheduled.

    Use the second argument in that function to retrieve the current time and add the desired amount of delay (expressed in seconds).

    Parameters

    • functionToCall: Function
    • anyFunctionArguement: any[]
    • modelTime: number

    Returns number