Y_INI fails to load anything inside the a file?
#1

Something that suprised me while I was scripting is that y_ini basic and y_ini advanced dosen't work together (?)

y_ini basic means:
pawn Код:
INI:mysql[](name[], value[])
{
    INI_String("Host", mysql_Host, sizeof(mysql_Host));
    INI_String("Username", mysql_Username, sizeof(mysql_Username));
    INI_String("Password", mysql_Password, sizeof(mysql_Password));
    INI_String("Database", mysql_Database, sizeof(mysql_Database));
    return 0;
}

INI_Load("mysql.ini");
y_ini advanced means:
pawn Код:
forward LoadFurniture(houseid, tag[], name[], value[]);
public LoadFurniture(houseid, tag[], name[], value[])
{
    new buildString[128];
    for(new obj = 1; obj < 2; obj++)
    {
        new modelID;
        format(buildString, sizeof(buildString), "ObjectID_%d_Model", obj);
        INI_Int(buildString, modelID);
        printf("%s // %d", buildString, modelID);
       
        new Float:modelX;
        format(buildString, sizeof(buildString), "ObjectID_%d_PosRX", obj);
        INI_Float(buildString, modelX);
        printf("%s // %f", buildString, modelX);
       
        new Float:modelY;
        format(buildString, sizeof(buildString), "ObjectID_%d_PosY", obj);
        INI_Float(buildString, modelY);
        printf("%s // %f", buildString, modelY);
       
        new Float:modelZ;
        format(buildString, sizeof(buildString), "ObjectID_%d_PosZ", obj);
        INI_Float(buildString, modelZ);
        printf("%s // %f", buildString, modelZ);
       
        new Float:modelRX;
        format(buildString, sizeof(buildString), "ObjectID_%d_PosRX", obj);
        INI_Float(buildString, modelRX);
        printf("%s // %f", buildString, modelRX);

        new Float:modelRY;
        format(buildString, sizeof(buildString), "ObjectID_%d_PosRY", obj);
        INI_Float(buildString, modelRY);
        printf("%s // %f", buildString, modelRY);

        new Float:modelRZ;
        format(buildString, sizeof(buildString), "ObjectID_%d_PosRZ", obj);
        INI_Float(buildString, modelRZ);
        printf("%s // %f", buildString, modelRZ);
       
        format(PropertyFurnitureInfo[houseid][propFurnitureData], 128, "%d,%d,%f,%f,%f,%f,%f,%f", obj, modelID, modelX, modelY, modelZ, modelRX, modelRY, modelRZ);
    }
    return 1;
}
INI_ParseFile(destString, "LoadFurniture", .bExtra = true, .extra = prop, .bPassTag = true);
The problem is, when I try to load the advanced script, it won't load any of the values inside house_1.ini

I have:
Quote:

ObjectID_1_Model = -1
ObjectID_1_PosX = 0.000000
ObjectID_1_PosY = 0.000000
ObjectID_1_PosZ = 0.000000
ObjectID_1_PosRX = 0.000000
ObjectID_1_PosRY = 0.000000
ObjectID_1_PosRZ = 0.000000
ObjectID_1_MI_1_FromObjID = -1
ObjectID_1_MI_1_TxdName =
ObjectID_1_MI_1_TextureName =
ObjectID_1_MI_1_MaterialColor = 0x0

It loads:
Quote:

ObjectID_1_Model = 0
ObjectID_1_PosX = 0.000000
ObjectID_1_PosY = 0.000000
ObjectID_1_PosZ = 0.000000
ObjectID_1_PosRX = 0.000000
ObjectID_1_PosRY = 0.000000
ObjectID_1_PosRZ = 0.000000
ObjectID_1_MI_1_FromObjID = 0
ObjectID_1_MI_1_TxdName =
ObjectID_1_MI_1_TextureName =
ObjectID_1_MI_1_MaterialColor = 0x0

(( MaterialColor would return: -1(%d), FFFFFF(%x), _(%s) ))

--

Whatever I do with the y_ini, is very very basic. Explained in tutorials. But yet, it does not work.
I can only assume it crashes due to y_ini basic and y_ini advanced working together.

Any ideas?
Reply
#2

Y_Ini for some reason, don't work in a loop. I had a similar problem too.
Reply
#3

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Y_Ini for some reason, don't work in a loop. I had a similar problem too.
yes it does!,
why dont you pears the files, loaded them into variables or something directly.
i have many systems that load in a loop and they are all parsing files.
one that is on the forum is mReg but not in a loop but same procedure.
Reply
#4

If anyone got a possible fix for this, please explain? @park4bmx or @]Rafaellos[
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)