Jump to content

Unzipping a .zip file?


xXMADEXx

Recommended Posts

  • Moderators

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

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

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

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