zocken212 Posted June 22, 2014 Share Posted June 22, 2014 Hey, I have used triggerLatentClientEvent and some other functions to make a custom downloader, everything works fine. But now I want to know how I can query the total bytes that has already been transferred since it has started. I hope you can help me. (Showing any code is unnecessary, if such answers occur) Best Regards Link to comment
MTA Team botder Posted June 22, 2014 MTA Team Share Posted June 22, 2014 Check out GetLatentEventStatus and use it clientside. Link to comment
zocken212 Posted June 22, 2014 Author Share Posted June 22, 2014 I want to know how many bytes has been transferred since the transfer has started.. example: 163/635 KB, not the percent Link to comment
MTA Team botder Posted June 22, 2014 MTA Team Share Posted June 22, 2014 If you learned maths in school then you can use the percentage and totalSize to calculate the transferred amount. Link to comment
zocken212 Posted June 22, 2014 Author Share Posted June 22, 2014 Got it working.. but no need to be rude Link to comment
MTA Team botder Posted June 22, 2014 MTA Team Share Posted June 22, 2014 Wasn't meant to be rude there. Anyway, some obvious things may not be noticed. Link to comment
arezu Posted June 23, 2014 Share Posted June 23, 2014 You cant use GetLatentEventStatus from client to check status of triggerLatentClientEvent. There are two solutions I can think of at the moment: 1. Use a timer to send percent complete for the latent event from server to client, and interpolate between the values each time to make it smoother. 2. Dont use a timer and instead use triggerClientEvent right after triggerLatentClientEvent to send the size of the data that is being sent (by using getLatentEventStatus), and then save getNetworkStats().bytesReceived in the client event to a variable and compare the bytes received from download start to current amount of bytes received (getNetworkStats().bytesReceived - bytesReceivedAtStart) in onClientRender to display it or something. Link to comment
Saml1er Posted October 22, 2014 Share Posted October 22, 2014 Check out GetLatentEventStatus and use it clientside. Omg. I nerver saw that function. Link to comment
MTA Team botder Posted October 22, 2014 MTA Team Share Posted October 22, 2014 That function only works on the scriptside, where the latent event has been started. That means you trigger a latent client event on serverside then you can use that handler only serverside, because it's not shared. 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