Jump to content

Prevent File


Recommended Posts

Hi guys. Im make download system. But i have problem.

Example;

filename skin/dead.col

for example:

if crete new text document and change name dead.col and set file path skin/dead.col the system is exists sense it. How can i prevent it?

Sry for my english .s

Link to comment
  • Moderators

You mean, people are applying their own mods?

You should use https://wiki.multitheftauto.com/wiki/DownloadFile instead of triggerLatentClientEvent.

To let the system check if the file is validated.

If you use triggerLatentClientEvent you can check if the filesize has chanced, but you won't be able to check the timestamp of the creation/edit time. Only mta can do that, so it a risk.

Link to comment

Read original files and store hash of their content somewhere

Then when checking if client has files,if he has, read those files that client has and turn the content into hash and compare this hash with your stored one. If hashes are different, client has tried to load his own mod.

Link to comment

From downloadFile wiki page:

If the file has been previously downloaded and the CRC matches, the file will not be downloaded again but onClientFileDownloadComplete will still run.

In other words: downloadFile will only download the file if the file doesn't exist, or if the file exists and the content of the file does not match the content of the file you want to download.

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