GetResourceLastStartTime: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
{{Deprecated_feature|3|1.0|
{{Deprecated_feature|3|1.0|
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
string getResourceLastStartTime ( resource theResource )
string/number getResourceLastStartTime ( resource theResource )
</syntaxhighlight>
</syntaxhighlight>
}}  
}}  


===Required Arguments===  
===Required Arguments===  
*'''theResource:''' The resource of which you'd like to check the last starting time and date.
*'''theResource:''' The resource of which you'd like to check the last starting time.


===Returns===
===Returns===
{{New feature|3|1.0 r840|
{{New feature|3|1.0 r840|
Returns seconds from last start.
If successful, returns the unix time when the resource was last started, or the string "never" if the resource has not been started yet, otherwise false.
 
}}
}}
{{Deprecated_feature|3|1.0|
{{Deprecated_feature|3|1.0|

Revision as of 09:42, 13 November 2011

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

Syntax

int getResourceLastStartTime ( resource theResource )

Required Arguments

  • theResource: The resource of which you'd like to check the last starting time.

Returns

If successful, returns the unix time when the resource was last started, or the string "never" if the resource has not been started yet, otherwise false.

Example

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

See Also