Loading screen, how to get the percentage completed?
1 replies, posted
I have absolutely no idea how to get the percentage done of the loading screen.
Any help is appreciated. Thanks
[editline]29th May 2016[/editline]
The percentage of how much you're downloading is completed.
You know the drill, 0 is nothing done, 100 is finished.
Look here: [url]https://wiki.garrysmod.com/page/Loading_URL#/Javascript_functions[/url]
There is a SetFilesTotal and a SetFilesNeeded function called by the client.
So simple:
[code]
var percentage = 0
var totalFiles = 1
function SetFilesTotal(total)
{
totalFiles = total;
}
function SetFilesNeeded(needed)
{
percentage = (totalFiles-needed)/totalFiles;
}
[/code]
Sorry, you need to Log In to post a reply to this thread.