Jump to content

Script Name


kewiiNNN

Recommended Posts

Well I know a few functions that could hide the default progress and then get the download info to be able to display it in a dx GUI like in your picture, the more complex part as I see it is how you can organize your resources, you could probably trigger onClientResourceStart for the resource root and get an event that starts as soon a specific resource is started and then add this resource first in your mtaserver.conf file to make it start first. Not sure if that would allow you to open and use a GUI during download tho.

Another option might be to focus only on the large files like pictures and stuff like that, setting their download parameter in meta.xml to false and use 'downloadFile' after they joined and logged in could probably allow you to download in the background as well. I'm not good enough in scripting to give and example of it but it should definitely be possible to do that.

Link to comment

$1.50 sounds cheap, will that include a GUI and all ;) Anyway, joking aside, downloadFile is the function you are looking for, either use that in every single resource to download pictures for example or a separate resource that handle downloads of any image based on the wiki example:

function onThisResourceStart ( ) 
    downloadFile ( "test.txt" ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart ) 

This will basically start the download after the resource is started, after that you may use some kind of exported function to access the images downloaded from the image resource, the reason for downloading all images in the same resource is that it may be easier to calculate total download time and then display it during the download.

Link to comment
$1.50 sounds cheap, will that include a GUI and all ;) Anyway, joking aside, downloadFile is the function you are looking for, either use that in every single resource to download pictures for example or a separate resource that handle downloads of any image based on the wiki example:
function onThisResourceStart ( ) 
    downloadFile ( "test.txt" ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart ) 

This will basically start the download after the resource is started, after that you may use some kind of exported function to access the images downloaded from the image resource, the reason for downloading all images in the same resource is that it may be easier to calculate total download time and then display it during the download.

Resource was sold with a progress bar :D

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