getResourceLastStartTime | Multi Theft Auto: Wiki Skip to content

getResourceLastStartTime

Client-side
Server-side
Shared

Manual Review Required

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


Used to check the last starting time and date of a resource

OOP Syntax Help! I don't understand this!

  • Method: resource:getLastStartTime(...)
  • Variable: .lastStartTime

Syntax

int getResourceLastStartTime ( resource theResource )
Required Arguments
  • theResource: The resource of which you'd like to check the last starting time.

Returns

  • int: value

If successful, returns the UNIX timestamp when the resource was last started, or the string "never" if the resource has not been started yet, otherwise false. Use in conjunction with getRealTime in order to retrieve detailed information.

Code Examples

shared

This function outputs to chatbox when the current resource was started.

function whenStarted()
local startTime = getResourceLastStartTime ( getThisResource() ) --Get the time and date
outputChatBox( "This resource was started on: " .. startTime ) --tell everybody when the current resource was started.
end