Jump to content

Custom downloading


Gravestone

Recommended Posts

Posted

I want to create a GUI window displaying all weapon/vehicle mods. I want to know when the client click to download them, how can I download the file? downloadFile doesn't work until I add the mods to meta and if I do so, the mods download when the resource start. I hope you people get what I am trying to do.

Posted
downloadFile 

The file should also be included in meta.xml with the download attribute set to "false".

Haven't played MTA for a while, just checked the forums, but I think that might help you.

Posted

Didn't see the download attribute thing. Anyways that's working now. Now I want to see if the client has downloaded the files. Used onClientDownloadComplete to replace models when he's in game. Now when the client re joins, the models do not replace. Tried fileExists but it checks if the file exists in the server. How do I fix this?

Posted
That's the problem, it returns if it exists on the server.

You are using fileExists to skip downloadFile, but fileExists does not check the file content.

downloadFile automatcially checks the existing file first, and will immediately trigger onClientFileDownloadComplete if download is not required.

Posted
That's the problem, it returns if it exists on the server.

It doesnt. I just tested it myself.

Make sure your script is client sided.

However, seems like Walid's solution is much better, so you don't need fileExists anyways.

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