Gravestone Posted August 13, 2016 Share Posted August 13, 2016 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. Link to comment
Gr0x Posted August 14, 2016 Share Posted August 14, 2016 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. Link to comment
Gravestone Posted August 14, 2016 Author Share Posted August 14, 2016 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? Link to comment
Gr0x Posted August 14, 2016 Share Posted August 14, 2016 If you check it client-sided, it should return if it exists on the client, not the server. Link to comment
Gravestone Posted August 14, 2016 Author Share Posted August 14, 2016 That's the problem, it returns if it exists on the server. Link to comment
Walid Posted August 14, 2016 Share Posted August 14, 2016 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. Link to comment
Gr0x Posted August 14, 2016 Share Posted August 14, 2016 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. Link to comment
Gravestone Posted August 14, 2016 Author Share Posted August 14, 2016 Nvm, I found out what was wrong. Thanks for your help @Gr0x and @Walid. Link to comment
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