Jump to content

Client-side file functions


Recommended Posts

Hey.

I've noticed that functions like fileCreate, fileWrite and fileClose work on client-side. However, when I try to do fileOpen or fileExists on a file that's in ANOTHER RESOURCE, It fails. I can confirm the file is really there on my computer.

Is there a built-in limitation to MTA that prevents reading files from other resources or am I just doing something wrong? If so, the information on wiki should be corrected immediately.

  
outputChatBox(tostring(fileExists(":testres/banana.lua"))) 
--> false 
  

Edit:

I've tried placing this line ouside the function where I need it, precisely in a "onClientResourceStart" event handler, and over there it works perfectly. As soon as I place this in any function that gets run at a latter time, it fails.

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