-.Paradox.- Posted April 20, 2014 Share Posted April 20, 2014 Hello, Can somebody see what's wrong here? Error in debugscript3 ERROR:Test/client:2:Attempt to call global 'downloadFile (a nil value) It suppose to download the car mod and apply it. client function onThisResourceStart ( ) downloadFile ( "579.dff" ) downloadFile ( "579.txd" ) end addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart ) 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 == "579.txd" ) then txd = engineImportTXD (file) engineReplaceModel ( txd, 579 ) end else -- if the file wasn't downloaded successfully if ( file == "579.txd" ) then outputChatBox ( "579.txd failed to download" ) end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) 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 == "579.dff" ) then dff = engineLoadDFF (file) engineReplaceModel ( dff, 579 ) end else -- if the file wasn't downloaded successfully if ( file == "579.dff" ) then outputChatBox ( "579.dff failed to download" ) end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) Meta.xml <meta> <script src="client.lua" type="client"></script> <file src="579.txd" download="false"></file> <file src="579.dff" download="false"></file> </meta> P.S: the files are located in the Test folder ":Test/579.txd" ":Test/579.dff" Link to comment
ixjf Posted April 20, 2014 Share Posted April 20, 2014 Are you using the 1.4 client? Those functions are not available prior to that version. Link to comment
Bonsai Posted April 20, 2014 Share Posted April 20, 2014 How many topics are you planning to create about this problem? Why don't you just set download to "true" so clients will download them automatically? Do you really want to waste any more time on this way of handling it? Link to comment
ixjf Posted April 20, 2014 Share Posted April 20, 2014 1.3.5 There's your issue. Those functions are not available prior to that version. Link to comment
-.Paradox.- Posted April 20, 2014 Author Share Posted April 20, 2014 Oh ok then ,thanks, is there another way to do it? Link to comment
Bonsai Posted April 20, 2014 Share Posted April 20, 2014 Yes, viewtopic.php?f=91&t=73971 viewtopic.php?f=91&t=73749 Link to comment
Moderators Citizen Posted April 20, 2014 Moderators Share Posted April 20, 2014 Oh ok then ,thanks, is there another way to do it? Yeah, get the 1.4 server and client that are still in development: https://nightly.multitheftauto.com/ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now