Markeloff Posted April 8, 2014 Share Posted April 8, 2014 Hello, Can anyone explains for me (give me an example) how to use properly fetchRemote to download two files(txd,dff) and replace a vehicle model with the downloaded files. Thank you, I'm pretty sure that the best answer will help hundred of scripters to handle fetchRemote and download problems. Link to comment
Saml1er Posted April 8, 2014 Share Posted April 8, 2014 Client side fetchRemote ( "www.TheDirectLinkToDFFoRtxdFILE.com/blahblah/file.txd", ReturnVal, "", false ) -- lets try downloading txd file from a direct link function ReturnVal( returnedDATA, errno ) if errno == 0 then _MyTxd = engineLoadTXD (returnedDATA) engineImportTXD ( _MyTxd, 1564 ) -- make sure you replace 1564 with the value you want else outputChatBox ("OMG DOWNLOADING FAILED DUE TO: "..errno) end end Not tested. If it doesn't work then please try /debugscript 3 and tell me what does it outputs. Link to comment
Spajk Posted April 8, 2014 Share Posted April 8, 2014 You must save the file client-side and then use that file via engineLoadTXD. Link to comment
Saml1er Posted April 8, 2014 Share Posted April 8, 2014 You must save the file client-side and then use that file via engineLoadTXD. I thought of adding it but I thought maybe the client downloads it and is auto saved. : D Anyway I'm on mobile now so to make it work correctly use fileCreate. Link to comment
Baseplate Posted April 8, 2014 Share Posted April 8, 2014 Well, you can use downloadFile with onClientFileDownloadComplete for this? Link to comment
Bonsai Posted April 8, 2014 Share Posted April 8, 2014 Well, you can use downloadFile with onClientFileDownloadComplete for this? Not yet. And according to the roadmap its not worth to wait for it. Link to comment
WASSIm. Posted April 8, 2014 Share Posted April 8, 2014 Well, you can use downloadFile with onClientFileDownloadComplete for this? FROM VERSION 1.4 ONWARDS Link to comment
Spajk Posted April 9, 2014 Share Posted April 9, 2014 And according to the roadmap its not worth to wait for it. You got yourself a fan. Link to comment
Noki Posted April 9, 2014 Share Posted April 9, 2014 Who knows, Markeloff might be using 1.4. You never know. Link to comment
DKongHD Posted April 9, 2014 Share Posted April 9, 2014 You can send the files via triggerLatentClient to the client. Just read them out with fileRead and send the source to the client. On the client, just create the file, write the source into it and then you can load it for whatever you want. Link to comment
Castillo Posted April 10, 2014 Share Posted April 10, 2014 No need to do that, fetchRemote is a easy and efficient function. The whole script can be done client side if the files are stored in the same server. Link to comment
Markeloff Posted April 13, 2014 Author Share Posted April 13, 2014 Who knows, Markeloff might be using 1.4. You never know. Nice hypo, but I will be using it. I know that DownloadFile isn't functional yet, but fetchRemote can solve the problem. Thank you guys, I solved the problem. 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