Loop through Y_INI
#1

Hello, is looping through a Y_INI tag possible?
Here is what I want to achieve:

For example in the .ini file:

pawn Код:
[exampletag]
blabla1 = 1  //1
blabla2 = 0  //2
blabla3 = 1  //3
blabla4 = 1  //4
blabla5 = 1  //5
I want to do a check through each one of the value of the tag (there are 5).

The questions:
1. How do I know there are 5 values under the [exampletag]?
2. How do I write a function loop that does something like this:

pawn Код:
enum exampletag
{
    blabla1,
    blabla2,
    blabla3,
    blabla4,
    blabla5
};
new BlaBlaInfo[MAX_PLAYERS][exampletag];

for (new i; i < sizeof(exampletag); i++)
{
    if (BlaBlaInfo[playerid][i] == 1)
    {
    // code
    }
}
If you don't understand it, tell me, I will try to explain it.
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
The INI_ParseFile already loops through items - that's the entire basis of the design of y_ini.
Is there a way to get the total items count under a tag and also insert a code for each line check?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)