xXMADEXx Posted August 29, 2013 Share Posted August 29, 2013 Hi guys, i don't think that its really possible via MTA, but why not ask... Is it possible to unzip a .zip file via Mta scripting? Link to comment
EstrategiaGTA Posted August 29, 2013 Share Posted August 29, 2013 I don't think that you can do it with Lua... Link to comment
xXMADEXx Posted August 29, 2013 Author Share Posted August 29, 2013 I don't think that you can do it with Lua... I don't think it is either... I hope MTA gets the luazip addon. Link to comment
Moderators IIYAMA Posted August 30, 2013 Moderators Share Posted August 30, 2013 well as far I know mta don't see a zip folder as a zip. He sees it simple as a folder, did you ever seen zip folders in your resource-cache ? no? cause they are unzipped. When you copie the files out of a zip folder, with the function: fileCopy and you put them in a new folder. (new folders,only possible at serverside) https://wiki.multitheftauto.com/wiki/FileCopy You are simply unzipping the folder. Link to comment
ixjf Posted August 30, 2013 Share Posted August 30, 2013 ZIP files aren't folders, though. Resources are unzipped in the resource cache because MTA uses an external library to decompress the files Link to comment
Moderators IIYAMA Posted August 30, 2013 Moderators Share Posted August 30, 2013 well it doesn't matter if is a zip or a folder, it can be done that way. Link to comment
xXMADEXx Posted August 30, 2013 Author Share Posted August 30, 2013 well as far I know mta don't see a zip folder as a zip. He sees it simple as a folder, did you ever seen zip folders in your resource-cache ? no? cause they are unzipped.When you copie the files out of a zip folder, with the function: fileCopy and you put them in a new folder. (new folders,only possible at serverside) https://wiki.multitheftauto.com/wiki/FileCopy You are simply unzipping the folder. uh im trying to unzip a file that I made the resource download, I don't think that it would work.. Link to comment
50p Posted August 31, 2013 Share Posted August 31, 2013 If MTA had binary functions, that is, if you could work on binary files (read and write) then you could use and sent clients .zip files, then you could uncompress them yourself via scripting. That way you could send a single .zip file containing images or sound files and then uncompress them. As long as we have no access to binary file operations we can't write our own libraries. fileRead only returns string so it's no use for binary files. Link to comment
DiSaMe Posted August 31, 2013 Share Posted August 31, 2013 You can work with binary files, since you can use string.byte on strings to get the values of bytes. That's what my bytedata script does, though it has problems reading the floating point values, and it's probably because of reduced precision on client, as using it on standalone Lua interpreter gave correct results. Nevertheless, built-in functions for binary file processing would be much faster. Link to comment
denny199 Posted August 31, 2013 Share Posted August 31, 2013 well as far I know mta don't see a zip folder as a zip. He sees it simple as a folder, did you ever seen zip folders in your resource-cache ? no? cause they are unzipped.When you copie the files out of a zip folder, with the function: fileCopy and you put them in a new folder. (new folders,only possible at serverside) https://wiki.multitheftauto.com/wiki/FileCopy You are simply unzipping the folder. uh im trying to unzip a file that I made the resource download, I don't think that it would work.. You can always use your common sense for this, there are many different ways to change lua files. Like this method: --Check for updates on the resource(like you did on your resources). If there's a update then --Download the files from your website ( via fetchremote server side), and then use fileWrite for writing in the specificed updated file. And voila, profit. if there's not a update then --return end. PS. (off-topic btw, don't start a fight against me here, please use the PM if you want a discussion LOL) Try next time not to lie on the community page, let me quote something ( https://community.multitheftauto.com/in ... ts&id=7797 ) Commed ID 6, where you are saying: "Thanks guys. @csmit, who ever said I don't know how to make one? For all you know im using on right now." Terrible liar. You didn't made an in-game browser, since the comment posting is a .php file... 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