Jump to content

Download


Recommended Posts

Hello guys, it's me again, I was searching in the forum for a way to download some files after client finish the current mta download, so I found this script https://community.multitheftauto.com/index.php?p= ... ls&id=3379 and I followed the instrunction but it isn't working, here is what I tried

  
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" and theFile == ":/test/cars/infernus.dff" then  
local theTXD = engineLoadTXD ( theFile )  
engineImportTXD ( theTXD, 411 ) 
local theDFF = engineLoadDFF ( theFile, 411 )  
engineReplaceModel ( theDFF, 411) 
 end 
 end) 

P.S: I added both of the resources in admin acl, and I make sure that it's running, I hope somebody help, thanks.

Link to comment
Hello guys, it's me again, I was searching in the forum for a way to download some files after client finish the current mta download, so I found this script https://community.multitheftauto.com/index.php?p= ... ls&id=3379 and I followed the instrunction but it isn't working, here is what I tried
  
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" and theFile == ":/test/cars/infernus.dff" then  
local theTXD = engineLoadTXD ( theFile )  
engineImportTXD ( theTXD, 411 ) 
local theDFF = engineLoadDFF ( theFile, 411 )  
engineReplaceModel ( theDFF, 411) 
 end 
 end) 

P.S: I added both of the resources in admin acl, and I make sure that it's running, I hope somebody help, thanks.

if theFile == ":/test/cars/infernus.txd" and theFile == ":/test/cars/infernus.dff" then

I guess it can't be both at the same time :o

Link to comment
Just a typo it is actually like this

if theFile == ":/test/cars/infernus.txd" and ":/test/cars/infernus.dff" then

and both of them aren't working.

xXMADEXx Nothing in debug..

That looks even more weird :o

Shouldn't it be like:

  
  
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 
  

Link to comment

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...