GetResourceLoadTime: Difference between revisions

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


===Returns===
===Returns===
{{New feature|3|1.0 r840|
If successful, returns seconds from loadtime, otherwise false.
}}
{{Deprecated_feature|3|1.0|
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.
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".
An example string is "Fri Mar 28 13:51:04 2008".
}}


==Example==
==Example==

Revision as of 11:59, 21 May 2009

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 seconds from loadtime, otherwise false.

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