OnClientFileDownloadComplete

From Multi Theft Auto: Wiki
Revision as of 17:16, 27 February 2012 by OpenIDUser34 (talk | contribs)
Jump to navigation Jump to search

This event is triggered when a file has been downloaded after downloadFile has been successfully called.

Parameters

string fileName, bool success
  • 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 ( success ) then
			if ( file == "test.mp3" ) then
				currentTrack = playSound ( "test.mp3" )
			end
		else
			if ( file == "test.mp3" ) then
				outputChatBox ( "test.mp3 failed to download" )
			end
		end
	end
end
addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish )

See Also

Other client events


Client event functions