OnClientFileDownloadComplete
From Multi Theft Auto: Wiki
FROM VERSION 1.4 ONWARDS
This event is triggered when a file has been downloaded after downloadFile has been successfully called.
Parameters
- fileName: the file downloaded.
- success: whether successful or not.
Source
The source of this event is the root element of the resource that called downloadFile.
Example
This example plays a sound if it was downloaded successfully
function onDownloadFinish ( file, success ) if ( source == resourceRoot ) then -- if the file relates to this resource if ( success ) then -- if the file was downloaded successfully if ( file == "test.mp3" ) then -- if the file name is what we were expecting currentTrack = playSound ( "test.mp3" ) end else -- if the file wasn't downloaded successfully if ( file == "test.mp3" ) then outputChatBox ( "test.mp3 failed to download" ) end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish )
See Also
Other client events
- onClientDebugMessage
- onClientHUDRender
- onClientMinimize
- onClientRestore
- onClientRender
- onClientExplosion
- onClientChatMessage
- onClientPreRender
FROM VERSION 1.4 ONWARDS
- onClientFileDownloadComplete
Client event functions
FROM VERSION 1.4 r4973 ONWARDS