Jump to content
  • 0

Issue with downloadFile?


xXMADEXx

Question

Hello everyone,

So, I'm currently updating my Mod Downloader script to support weapons and skin models. However, I've been running into an issue with downloadFile. I'm not sure if it is something that I am doing in the script, or if it is an issue with MTA itself.

The MTA client says that the files do not exist. Every once in a while it will successfully find and download them, but most often times it says that the files don't exist.

Screens:

Error IG (Note that the debug message displays the same file path that is passed into downloadFile)

http://i.imgur.com/nxCyRPd.jpg

nxCyRPd.jpg

Meta file:

http://i.imgur.com/JJP4qks.png

JJP4qks.png

Files:

http://i.imgur.com/UWLoqhd.png

UWLoqhd.png

I cannot figure out for the life of me of why this is not working.

Any help is greatly appreciated.

Thanks,

xXMADEXx

Edit: Restarting the server seems to make the files actually able to download, but restarting the server whenever something is added is just ridiculous

Edited by Guest
  • Like 1
Link to comment

19 answers to this question

Recommended Posts

  • 0
I've never encountered this error without me making a mistake, and i am not really sure why is this happening to you, maybe because script starts checking if file exists before they got loaded from meta?Other than that, i dont know what could be the issue

I honestly have no idea why it does this. After a while, it will just start randomly loading the files though. Still haven't found out why.

Link to comment
  • 0
Client resource must be started before you can access it's files, otherwise file/xml functions will return false when trying to access them.

This script only sends the server a request for the mods list until the server has replied, but it doesn't do anything with files until the server has successfully loaded and checked all the mods and sends the response to the client.

Link to comment
  • 0
Client resource must be started before you can access it's files, otherwise file/xml functions will return false when trying to access them.

This script only sends the server a request for the mods list until the server has replied, but it doesn't do anything with files until the server has successfully loaded and checked all the mods and sends the response to the client.

What are you saying?

Link to comment
  • 0
Client resource must be started before you can access it's files, otherwise file/xml functions will return false when trying to access them.

This script only sends the server a request for the mods list until the server has replied, but it doesn't do anything with files until the server has successfully loaded and checked all the mods and sends the response to the client.

What are you saying?

Basically that the client script doesn't use any files before it's completely started.

Link to comment
  • 0
The files should also be included in meta.xml with the download attribute set to "false"

Yes. The script automatically adds that when it detects a new file then restarts the resource. I've tried restarting the resource several times but it still gives the error.

Link to comment
  • 0
Does the downloadFile work, if you manually add download="false" tags onto the file nodes you want to download?

I'm not sure why but I actually just now discovered that if after the mods are added to meta.xml and it is giving the error, if you go into the meta and change anything (eg. just put another space somewhere) and restart the resource again the files will be able to download just fine. This is a very strange bug.

ModDownloader resource does not do anything when started.

Give me a resource which reproduces the issue.

Ok.

1. Download & extract this resource:

2. Start server, when server is started start the ModDownloader resource

3. Once the ModDownloader resource has started open the following file: ModDownloader/smods.xml

4. Remove the commented line, on line 4, resulting in this:

<mods> 
  
    <vehicles> 
        <mod name="1951 Chevy" txd="sadler.txd" dff="sadler.dff" replace="543" /> 
    </vehicles> 
     
    <skins></skins> 
    <weapons></weapons> 
</mods> 

This will enable the mod

5. Restart the 'ModDownloader' resource, it will add the mod to meta.xml then restart itself. Once it has started again it should give an error from downloadFile saying that the file doesn't exist.

I show how to reproduce it in this video:

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