SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Zdarzenia klienta
  3. onClientTransferBoxProgressChange

Zdarzenie

onClientTransferBoxProgressChange

KlientZasobyIdentyczne z MTA:SA

Postęp pobierania plików (start zasobu albo downloadFile), najwyżej około 10 razy na sekundę. Przydaje się do własnego paska pobierania.

Obsługa

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

Parametry

downloadedSizeTotalint
Pobrane bajty.
downloadTotalBytesint
Wszystkie bajty.

Źródło

source to root.

Przykład

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)

Zobacz też