Is it possible to create a txt file in-game?
#1

I wonder if it possible to create a txt file in game, but I'm not talking about a regular file created by libraries.

I wonder if it possible to use those f-functions (fopen, fclose), I ******d this yet I couldn't find anything.
And if not, when using ini libraries it is possible to insert a formatted string into a file right?

(Haven't used ini libraries in a while..)
Reply
#2

Hello.Maybe this would help.
https://sampwiki.blast.hk/wiki/File_Functions
Reply
#3

yes, as he said above, but, i advice you using ******'s one, (y_ini) Fast saving and loading.
Reply
#4

As I've stated.
I'd like not to use any sort of library, I want to use functions instead but if that isn't possible.
Then y_ini would be the one I'd go with.
Reply
#5

Depends on what your doing, if it's a user file system then you will want y_ini at the very least if you are just exporting/importing data then the file functions alone are suitable.
Reply
#6

No, no, I'm actually attempting to create a dynamic system that'll create information into an ini file.
Also I'd like it to create a file using a function in pawno, I wonder if fopen wouldn't just open a ini file or a txt one but create one aswell if it exists?
Anyways it's not for loading or saving, it's just for simple writing.
Reply
#7

If you want it to be like this:
Код:
Key = Value
Then you should just use y_ini.

But if you want to write something else, use the sa-mp file functions.
Reply
#8

I know that, but if you could read my post above and reply.

And I'd like to mention again, does fopen creates/opens a file or just opens it?
Reply
#9

Quote:
Originally Posted by Ox1gEN
Посмотреть сообщение
I know that, but if you could read my post above and reply.

And I'd like to mention again, does fopen creates/opens a file or just opens it?
If it's io_write, then it creates and opens it.
If it was io_append, io_read, it opens it (Note server will crash if it doesn't exist)

I'm not really sure about this but I think io_readwrite also opens it and also crashes if doesn't exists.
Reply
#10

Quote:
Originally Posted by Stinged
Посмотреть сообщение
If it's io_write, then it creates and opens it.
If it was io_append, io_read, it opens it (Note server will crash if it doesn't exist)

I'm not really sure about this but I think io_readwrite also opens it and also crashes if doesn't exists.
You just gave me what I was looking for, thanks m8y m8.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)