-.Paradox.- Posted April 9, 2014 Posted April 9, 2014 Hello, can somebody help me how to use fetchRemote to download and apply some car mods(dff and txd) when player finish his current download, lie a background download so the player can play and download in the same time, thanks.
TrapLord Studios™ Posted April 10, 2014 Posted April 10, 2014 Right, so basically fetchRemote allows clients to download files from HTTP servers. https://wiki.multitheftauto.com/wiki/FetchRemote
-.Paradox.- Posted April 10, 2014 Author Posted April 10, 2014 But how I can check when the player finish the Mta download and start downloading the car mods?
Woovie Posted April 10, 2014 Posted April 10, 2014 It won't help.. ... onClientResourceStart will fire when the resource is finished downloading. Start your downloads using this event.
Gallardo9944 Posted April 10, 2014 Posted April 10, 2014 it's actually onClientResourceStart with resourceRoot, not with a simple root. Just not to confuse the OP author
-.Paradox.- Posted April 10, 2014 Author Posted April 10, 2014 Thanks anyway, i posted that code in forum but nobody helped, hope someone see what's wrong, or just show me how i can use fetchRemote. addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource ()), function () exports.download:downloadFile ("infernus.txd", "infernus.txd", 500) exports.download:downloadFile ("infernus.dff", "infernus.dff", 500) end) addEventHandler ("onClientDownloadComplete", getRootElement(), function (theFile) if theFile == ":/test/cars/infernus.txd" then local theTXD = engineLoadTXD ( theFile ) engineImportTXD ( theTXD, 411 ) elseif theFile == ":/test/cars/infernus.dff" then local theDFF = engineLoadDFF ( theFile, 411 ) engineReplaceModel ( theDFF, 411) end end)
Bonsai Posted April 10, 2014 Posted April 10, 2014 If its only about these 2 files, why don't you just put them in your meta so they get auto downloaded? You can still create a function to enable/disable them or a function to delete them after they were imported if its about protection.
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