getLatentEventStatus | Multi Theft Auto: Wiki Skip to content

getLatentEventStatus

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.


Gets the status of one queued latent event.

Syntax

table getLatentEventStatus ( int handle )
Required Arguments
  • handle: A handle previous got from getLatentEventHandles .

Returns

  • table: value

Returns a table with the following info or false if invalid arguments were passed:

Code Examples

client

The example starts a latent event and outputs the status of the transfer to the client console

function beginTransfer()
triggerLatentServerEvent("blah", resourceRoot, myVeryLongString) -- Start latent event
myHandle = getLatentEventHandles()[#getLatentEventHandles()] -- Get last latent event handle
myTimer = setTimer( updateStatus, 1000, 0 ) -- Output status once a second
end
function updateStatus()
local status = getLatentEventStatus(myHandle) -- Get latent event status
if not status then
killTimer(myTimer) -- getLatentEventStatus returns false when the handle is no longer valid
else
outputConsole( "Transfer status:"
.. " tickStart:" .. tostring(status.tickStart)
.. " tickEnd:" .. tostring(status.tickEnd)
.. " totalSize:" .. tostring(status.totalSize)
.. " percentComplete:" .. tostring(status.percentComplete)
)
end
end