y_ini reading problem -
[XST]O_x - 09.09.2014
I can't find where the problem is:
pawn Код:
INI:words[](name[], value[])
{
new posHolder[16];
printf("Word count: %d", wordCount);
for(new i = 0; i < wordCount; i++) {
//if(forbiddenWordSlotUsed[i]) {
format(posHolder, sizeof posHolder, "Word_%d", i);
INI_String(posHolder, forbiddenWords[i], MAX_WORD_LENGTH);
new l = AddForbiddenWord(forbiddenWords[i], strlen(forbiddenWords[i]));
printf("Forbidden word %s loaded (%d)", forbiddenWords[i], l);
//}
}
return 0;
}
The file loading is called multiple times, debugged:
pawn Код:
Word count: 5
Word count: 5
Forbidden word x loaded (0)
Word count: 5
Forbidden word x loaded (1)
Forbidden word x loaded (2)
Word count: 5
Forbidden word x loaded (3)
Forbidden word x loaded (4)
Forbidden word y loaded (5)
Word count: 5
Forbidden word x loaded (6)
Forbidden word x loaded (7)
Forbidden word y loaded (8)
Forbidden word z loaded (9)
As you see, the same word ('x') is loaded multiple times, the second and third once, and the fourth and fifth aren't loaded at all. What the heck?
The files are saved normally. The 'words.ini' file:
pawn Код:
Word_0 = x
Word_1 = y
Word_2 = z
Word_3 = x1
Word_4 = y1
x1 and y1 are not touched.
Oh, and by the way, INI_Load is only called ONCE in OnFilterScriptInit.
Re: y_ini reading problem -
[XST]O_x - 10.09.2014
Bump
Re: y_ini reading problem -
dusk - 10.09.2014
This seems to be a common problem:
https://sampforum.blast.hk/showthread.php?tid=473278 Yet no answer for it.
Re: y_ini reading problem -
[XST]O_x - 10.09.2014
Quote:
Originally Posted by dusk
|
Oh, I see. Thanks for pointing that out.
Is there any other way I can load files with y_ini?
Re: y_ini reading problem -
Kaperstone - 10.09.2014
MySQL if that's an option.
Re: y_ini reading problem -
dusk - 10.09.2014
Or you may try using y_ini from
YSI 4.0. Although I'm not sure if was changed...
Re: y_ini reading problem -
[XST]O_x - 10.09.2014
Using version 4.0 didn't change anything unfortunately.
MySQL? Why would I use MySQL?
Anyway, I'll try to get ****** to see what's up with INI_Load
Re: y_ini reading problem -
dusk - 10.09.2014
Well MySQL is a nice alternative for storing data.
Re: y_ini reading problem -
[XST]O_x - 10.09.2014
Quote:
Originally Posted by dusk
Well MySQL is a nice alternative for storing data.
|
I never learned and don't want to learn (not to mention changing my whole script to MySQL) it.
Thanks anyway for this tip.
But does anyone know how to solve this problem and continue using y_ini?