Help me with file reading (Y_ini) -
Gilbonzo - 25.04.2014
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!
Re: Help me with file reading (Y_ini) -
Ada32 - 25.04.2014
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..
Re: Help me with file reading (Y_ini) -
Gilbonzo - 25.04.2014
I know that it would be more easier, but I am not using it right now.
Re: Help me with file reading (Y_ini) -
horsemeat - 25.04.2014
the code you displayed just saves the file do you not know how to use y INI
Re: Help me with file reading (Y_ini) -
Ada32 - 25.04.2014
well natively no, you won't be able to loop through the directory (perhaps someone wrote something in the plugins section)
Re: Help me with file reading (Y_ini) -
Gilbonzo - 25.04.2014
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.
Re: Help me with file reading (Y_ini) -
PrinceKumar - 25.04.2014
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
Re: Help me with file reading (Y_ini) -
Gilbonzo - 25.04.2014
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.
Re: Help me with file reading (Y_ini) -
PrinceKumar - 25.04.2014
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
Re: Help me with file reading (Y_ini) -
Gilbonzo - 25.04.2014
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.