isTransferBoxActive | Multi Theft Auto: Wiki Skip to content

isTransferBoxActive

Client-side
Server-side
Shared

This function returns whether the file downloading dialog box is active or not. This appears when a resource is started and the client doesn't have all the files that resource requires the client to have.

It's important to note that resources aren't started on the client until they're completely downloaded, so a resource cannot use this function to detect if it's own files are downloaded. A client-side resource triggers the onClientResourceStart event when the files it requires are downloaded.

OOP Syntax Help! I don't understand this!

  • Method:GuiElement.isTransferBoxActive(...)
  • Variable: .transferBoxActive

Syntax

bool isTransferBoxActive ( )

Returns

Returns true if the file transfer box is visible, false if not.

  • bool: result

Code Examples

client

This makes the camera fade in, once all resource downloads are finished.

fadeCamera(false)
function checkTransfer()
if isTransferBoxActive() then
setTimer(checkTransfer, 2000, 1) -- TransferBox is still active, check again after 2 seconds.
else
fadeCamera(true) -- TransferBox isn't active, fade in camera.
end
end
addEventHandler("onClientResourceStart", resourceRoot, checkTransfer)

See Also

GUI Functions