getResourceLoadTime | Multi Theft Auto: Wiki Skip to content

getResourceLoadTime

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


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

Syntax

getResourceLoadTime ( )

Code Examples

server

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

local res = getResourceFromName ( "scoreboard" )
if res then
local time = getRealTime(getResourceLoadTime(res)) --Gets all the data we need from UNIX time format, see getRealTime() for more details
outputConsole ( "scoreboard was last loaded on: " .. string.format("%i/%i/%i %i:%i:%i",time.monthday,time.month,time.year,time.hour,time.minute,time.second)) --this will be something like this: scoreboard was last loaded on: 10/07/2017 14:13:10
end