Jump to content

[HELP] When client resources is downloading


#Kz

Recommended Posts

Hi.

How i can find a way to detect client resource download processing and create a message, gui and ... while it?

Example:
When i've connected to a server for first time, I'll download some resources, while it a warning like a message or GUI Text will be displayed like: Resource Download Process 80% which it isn't from MTA, it's created by that server development Team.

I know that's easy to find but i wanna get my answer from here with some examples!

 

[Thanks for watching this topic].

Edited by #Kz
Link to comment

You'll have to set all the files in the meta to download="false", so only scripts are downloaded when the player connects.
As scripts are usually fairly small it shouldn't take too long. After that you'll have to make a custom downloader to load all the files.

For that you will have to use the downloadFile function as well as the onClientFileDownloadComplete event.
While I don't think that you can get the status of the currently downloading file you can get the progress of the overall download by getting all files sizes and working with them.

Edited by 3aGl3
  • Like 1
Link to comment
16 hours ago, Fist said:

I'm pretty sure you can't get process of download which is MTA's built-in, you have to make your own downloader for that. Not sure how to do it though, i'm guessing using fetchRemote.

Thanks!

 

2 hours ago, 3aGl3 said:

You'll have to set all the files in the meta to download="false", so only scripts are downloaded when the player connects.
As scripts are usually fairly small it shouldn't take too long. After that you'll have to make a custom downloader to load all the files.

For that you will have to use the downloadFile function as well as the onClientFileDownloadComplete event.
While I don't think that you can get the status of the currently downloading file you can get the progress of the overall download by getting all files sizes and working with them.

Helpful.

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