getLatentEventStatus
Server
Tells how a latent event the server is sending to a player is going.
Also exists on the client, with its own implementation: getLatentEventStatus
table|false getLatentEventStatus(player thePlayer, int handle)
Parameters
| Name | Type | Description |
|---|---|---|
| thePlayer | player | The player receiving the event. |
| handle | int | A handle from getLatentEventHandles for that player. |
Returns
A table with tickStart and tickEnd (on the getTickCount scale; tickEnd is an estimate while sending and the real end afterwards), totalSize (bytes) and percentComplete (0 to 100). false if the handle does not exist or the transfer finished more than a second ago.
Example
addCommandHandler("download", function(player)
for _, handle in ipairs(getLatentEventHandles(player)) do
local status = getLatentEventStatus(player, handle)
if status then
outputDebugString(getPlayerName(player) .. ": " .. status.percentComplete .. "%")
end
end
end)