Jump to content

fetchRemote


Recommended Posts

Posted

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.

Posted
It won't help..

...

onClientResourceStart will fire when the resource is finished downloading. Start your downloads using this event.

Posted

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) 

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...