GetTime: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">getTime ()</syntaxhighlight>
<syntaxhighlight lang="lua">int int getTime ()</syntaxhighlight>


===Returns===
===Returns===
Line 12: Line 12:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local hour, mins = getTime ()
local hour, mins = getTime ()
outputChatBox ( "The current time is ".. hour ..":".. mins )
outputChatBox ( "The current time is " .. hour .. ":" .. mins )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{World functions}}
{{World functions}}

Revision as of 18:15, 17 August 2007

This function is used to get the current time in the game.

Syntax

int int getTime ()

Returns

Returns two ints that represent hours and minutes.

Example

local hour, mins = getTime ()
outputChatBox ( "The current time is " .. hour .. ":" .. mins )

See Also