pro-mos Posted February 23, 2017 Share Posted February 23, 2017 My script downloads files on the player's pc as he play script/cache/water.fx script/cache/wrap.txd So when i try to use these files client side with -- egineLoadtxd -- and/or dxCreateShader('cache/water.fx') It doesn't work, with a warning like file not found.Do i have to include downloaded files to the meta.xml? Link to comment
xyzii Posted February 23, 2017 Share Posted February 23, 2017 Yes, use <file src="filename.type"/> in meta Link to comment
pro-mos Posted February 23, 2017 Author Share Posted February 23, 2017 9 minutes ago, xyzii said: Yes, use <file src="filename.type"/> in meta But how? These files doesn't exist on starting the script, but they're downloaded when a new map starts. You see im trying to do a script loader Link to comment
MIKI785 Posted February 23, 2017 Share Posted February 23, 2017 Obviously you have to finish downloading them before you run the dx functions. How do you actually download them? Link to comment
pro-mos Posted February 23, 2017 Author Share Posted February 23, 2017 11 minutes ago, MIKI785 said: Obviously you have to finish downloading them before you run the dx functions. How do you actually download them? the server sends the file data and i write them client side with fileCreate('cache/'..filename) after creating and writing the file, i try to load it right away. Link to comment
MIKI785 Posted February 23, 2017 Share Posted February 23, 2017 Might be a stupid question but do you use fileClose first? it should work otherwise, i guess you're using trigger(Latent)ClientEvent, right? In that case it shouldn't be able to get corrupted either. Show me how you load the files and send them on the server. Link to comment
pro-mos Posted February 23, 2017 Author Share Posted February 23, 2017 (edited) i use triggerClientEvent to send the files, and i write them with fileWrite, and then close the files with fileClose, the files are fine, i can see them downloaded in deathmatch/resources/script/cache/water.fx i think it might be a file path error, since im getting confused of how MTA's file path works EDIT: i've found the problem was the files download with a script and i try to use them with another script.. i've added ':scriptname' to the file path and now it works, sorry for your time. Edited February 23, 2017 by pro-mos Link to comment
MIKI785 Posted February 23, 2017 Share Posted February 23, 2017 Ok then. But just a bit of advice, dont use triggerClientEvent to transfer large amount of data as it could stall the server. Use triggerLatentClientEvent instead. 1 Link to comment
pro-mos Posted February 23, 2017 Author Share Posted February 23, 2017 4 hours ago, MIKI785 said: Ok then. But just a bit of advice, dont use triggerClientEvent to transfer large amount of data as it could stall the server. Use triggerLatentClientEvent instead. i tried this latent event now, and it seems a lot slower than the normal triggerClientEvent, i've tested it on local server Link to comment
MIKI785 Posted February 24, 2017 Share Posted February 24, 2017 (edited) That's intentional, but you're able to change the maximum transfer rate using the bandwidth argument. So if your server has a good connection you can increase it. Edited February 24, 2017 by MIKI785 1 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