ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientTransferBoxProgressChange

Event

onClientTransferBoxProgressChange

ClientResourcesIdentical to MTA:SA

File download progress (a resource start or downloadFile), at most about 10 times per second. Useful for your own download bar.

Handler

addEventHandler("onClientTransferBoxProgressChange", root, function(downloadedSizeTotal, downloadTotalBytes) ... end)

Parameters

downloadedSizeTotalint
Downloaded bytes.
downloadTotalBytesint
Total bytes.

Source

source is root.

Example

local done, total = 0, 0
addEventHandler("onClientTransferBoxProgressChange", root, function(d, t) done, total = d, t end)
addEventHandler("onClientRender", root, function()
    if total > 0 and done < total then
        dxDrawRectangle(20, 20, 300 * done / total, 10, tocolor(255, 122, 34))
    end
end)

See also