JeViCo Posted June 18, 2019 Posted June 18, 2019 Hi guys! I've recently tried to change file client-side however i got none. meta.xml: <meta> <script src="client.Lua" type="client" /> <file src="testfile.txt" /> </meta> testfile.txt (server-side): sometext here client.Lua: local file = fileOpen('testfile.txt') fileClear(file) -- clear file local content = 'some new text' fileWrite(file, content) print(#content) -- got 13 print(#fileRead(file, fileGetSize(file))) -- always get 0 fileClose(file) acl.xml has resource.* permission and debug doesn't give any hints any ideas?? i used this function (same happens if a recreate file)
N3xT Posted June 18, 2019 Posted June 18, 2019 Try this: local file = fileOpen('testfile.txt') fileClear(file) -- clear file local content = 'some new text' fileWrite(file, content) print(#content) -- got 13 local fileContent = fileRead(file, fileGetSize(file)) fileClose(file) print(#fileContent)
Moderators IIYAMA Posted June 18, 2019 Moderators Posted June 18, 2019 @JeViCo There is nothing written on that file yet, not until the is finished. That poor creature needs a toilet and fast. https://wiki.multitheftauto.com/wiki/FileFlush 1 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
JeViCo Posted June 19, 2019 Author Posted June 19, 2019 it seems working. Thank you! You saved my time 1
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