Save money to .txt file?


#1

Hi,

I recently have been trying to make it so when a player joins, they have 0 money, and it saves their money to a .txt file, so when they rejoin. They have the money that was saved to the .txt file.
I have tried using these natives:
https://runtime.fivem.net/doc/reference.html#_0x76a9ee1f
https://runtime.fivem.net/doc/reference.html#_0xa09e7e7b
But miserably failed, any help appreciated.

Thanks,
Scotty


#2

What have you tried exactly because those natives are the right ones to read and write to files.

In case you don’t want to use natives you can also use LUA I/O functions, but they require you to specify a specific file path and apparently this only works for windows, at least some people using ubuntu complained that it didn’t work.
https://www.lua.org/manual/5.1/manual.html#5.7


#3

Is there any examples with FiveM?


#4

[Release] vHelp (v2.0) - Simple /help and /rules script checkout the " v1.2 info (OLD VERSION, UPGRADE TO V2.0 WHENEVER POSSIBLE)" spoiler, the download for the old version is still up which includes a lua IO example