Help me with file reading (Y_ini)
#1

So hello everyone!

I have a small problem with loading players files while they are offline or online.

The code I use:

pawn Код:
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new file[96];format(file,sizeof file,"/Users/%s.ini",name);
    new INI:vdata = INI_Open(file);
    INI_WriteInt(vdata,"UpdateLog",pInfo[playerid][UpdateLog] = 1);
    INI_Close(vdata);
I have a folder where are the players data .ini files they are "Firstname_Lastname.ini" format so I want to load every players data file and writing to each of them. I might sound hard, but I know that there has to be some way to do it.

I am using right now to open my own player file, but is very difficult for me to load every player data file and write to all of them like looping or something like that.

Any help would be appreciated!
Reply
#2

Quote:

so I want to load every players data file and writing to each of them.

the only logical way is to use a database. text files are meant to be independent. so..
Reply
#3

I know that it would be more easier, but I am not using it right now.
Reply
#4

the code you displayed just saves the file do you not know how to use y INI
Reply
#5

well natively no, you won't be able to loop through the directory (perhaps someone wrote something in the plugins section)
Reply
#6

Quote:
Originally Posted by horsemeat
Посмотреть сообщение
the code you displayed just saves the file do you not know how to use y INI
I do know how to use y_INI but not that much.
Reply
#7

If i m getting right then use INI_ParseFile to load ur data and create any cmd which can update ur variables
edit:
why u don't ****** about its tutorial there are some best tutorial to learn y ini
Reply
#8

Quote:
Originally Posted by PrinceKumar
Посмотреть сообщение
If i m getting right then use INI_ParseFile to load ur data and create any cmd which can update ur variables
edit:
why u don't ****** about its tutorial there are some best tutorial to learn y ini
If you have any idea how to do it could you give an example how it would work? I also have been looking from ****** but I found nothing.
Reply
#9

U can get to know how to y ini fom this tutorial btw forget about register n login cmd n all other information will be same for ur functions
link: forum.sa-mp.com/showthread.php?t=273088
Reply
#10

Quote:
Originally Posted by PrinceKumar
Посмотреть сообщение
U can get to know how to y ini fom this tutorial btw forget about register n login cmd n all other information will be same for ur functions
link: forum.sa-mp.com/showthread.php?t=273088
Register and login system isnt actually what im looking for right now. I want to open every player file and then write to each of them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)