GetResourceLoadTime

From Multi Theft Auto: Wiki
Revision as of 13:03, 28 March 2008 by Arc (talk | contribs) (New page: __NOTOC__ {{Server function}} Gets the date and time at which a resource was last loaded in the server. ==Syntax== <syntaxhighlight lang="lua"> string getResourceLoadTime ( resource res ) </syntaxhighlight> ===Requ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Gets the date and time at which a resource was last loaded in the server.

Syntax

string getResourceLoadTime ( resource res )

Required Arguments

  • res: the resource you want to know the load time of.

Returns

If successful, returns a string with the date and time that the resource was last loaded into memory (for example when the server started, or when the resource was changed and reloaded). Returns false on failure.

An example string is "Fri Mar 28 13:51:04 2008".

Example

This code outputs the date and time at which the scoreboard resource was last loaded.

local res = getResourceFromName ( "scoreboard" )
if res then
    outputConsole( "scoreboard was last loaded on: " .. getResourceLoadTime(res) )
end

See Also