Another weird y_ini reading problem
#1

Hey... in addition to my previous thread, I've got another problem with y_ini.
The values save perfectly into the right key in the file, but they are not read, at all.
pawn Код:
INI_WriteInt(File, "panel", vInfo[v][panel]);
INI_WriteInt(File, "door", vInfo[v][door]);
INI_WriteInt(File, "light", vInfo[v][light]);
INI_WriteInt(File, "tire", vInfo[v][tire]);
This code saved perfectly. When I open the files after unloading the FS, I see all the values as they should.

On the other hand:
pawn Код:
INI_Int("panel", vInfo[v][panel]);
INI_Int("door", vInfo[v][door]);
INI_Int("light", vInfo[v][light]);
INI_Int("tire", vInfo[v][tire]);
These values just won't load back into their variables. The vars stay null.
To check it out I've tried printing the values RIGHT after loading them:
pawn Код:
INI_Int("panel", vInfo[v][panel]);
INI_Int("door", vInfo[v][door]);
INI_Int("light", vInfo[v][light]);
INI_Int("tire", vInfo[v][tire]);
printf("%d | %d | %d | %d | %d", v, vInfo[v][panel]  , vInfo[v][door]  , vInfo[v][light], vInfo[v][tire] );
Results:
Quote:

5 | 0 | 0 | 0 | 0

All other 20+ variables are saved AND read perfectly, these 4 just won't.
I have no idea how to fix it... I tried using binaries(because vehicle damage status do print out as binary numbers), and again, the damage saved perfectly (0b0001000,...) but after loading, it came back to be 0.
Reply
#2

Yep. I don't really get the second part of your post, though.
pawn Код:
LoadVehicle(v, file[])
{
    INI_ParseFile(file, "vehicle_load_%s", .bExtra = true, .extra = v);
    CreateSystemVehicle(vInfo[v][model], vInfo[v][x], vInfo[v][y], vInfo[v][z], vInfo[v][a], vInfo[v][col1], vInfo[v][col2], vInfo[v][owner]);
    ChangeVehiclePaintjob(vInfo[v][id], vPaintjob[v]);
    printf("%d | %d | %d | %d | %d", v, vInfo[v][panel]  , vInfo[v][door]  , vInfo[v][light], vInfo[v][tire] );
    UpdateVehicleDamageStatus(vInfo[v][id], vInfo[v][panel], vInfo[v][door] ,vInfo[v][light], vInfo[v][tire]);
    for(new i = 0; i < 14; i++) AddVehicleComponent(vInfo[v][id], vInfo[v][comps][i]);
}
That's where the print function is
Reply
#3

The tags are correct, for the last 100 times I, personally, checked.
The enum:
pawn Код:
enum v_info_
{
    id,
    model,
    col1,
    col2,
    Float: x,
    Float: y,
    Float: z,
    Float: a,
    owner[MAX_PLAYER_NAME],
    comps[14],
    panel,
    door,
    light,
    tire
}
The weirder thing is:
printing the values in vehicle_load_data:
pawn Код:
forward vehicle_load_data(v, name[], value[]);
public vehicle_load_data(v, name[], value[])
{
    new strComp[10];
    INI_Int("model", vInfo[v][model]);
    INI_Int("col1", vInfo[v][col1]);
    INI_Int("col2", vInfo[v][col2]);
    INI_Float("x", vInfo[v][x]);
    INI_Float("y", vInfo[v][y]);
    INI_Float("z", vInfo[v][z]);
    INI_Float("angle", vInfo[v][a]);
    INI_String("owner", vInfo[v][owner], MAX_PLAYER_NAME);
    INI_Int("paintjob", vPaintjob[v]);
    INI_Int("panel", vInfo[v][panel]);
    INI_Int("door", vInfo[v][door]);
    INI_Int("light", vInfo[v][light]);
    INI_Int("tire", vInfo[v][tire]);
    printf("%d | %d | %d | %d | %d", v, vInfo[v][panel]  , vInfo[v][door]  , vInfo[v][light], vInfo[v][tire] );
    for(new i = 0; i < 14; i++) {format(strComp, sizeof(strComp), "comp%d", i); INI_Int(strComp, vInfo[v][comps][i]); }
    return 1;
}
Is giving me the CORRECT values that were saved in the file.
However, printing it in LoadVehicle:
pawn Код:
LoadVehicle(v, file[])
{
    INI_ParseFile(file, "vehicle_load_%s", .bExtra = true, .extra = v);
    CreateSystemVehicle(vInfo[v][model], vInfo[v][x], vInfo[v][y], vInfo[v][z], vInfo[v][a], vInfo[v][col1], vInfo[v][col2], vInfo[v][owner]);
    ChangeVehiclePaintjob(vInfo[v][id], vPaintjob[v]);
    printf("%d | %d | %d | %d | %d", v, vInfo[v][panel]  , vInfo[v][door]  , vInfo[v][light], vInfo[v][tire] );
    UpdateVehicleDamageStatus(vInfo[v][id], vInfo[v][panel], vInfo[v][door] ,vInfo[v][light], vInfo[v][tire]);
    for(new i = 0; i < 14; i++) AddVehicleComponent(vInfo[v][id], vInfo[v][comps][i]);
}
Prints out zeros. Again, all other information is correct.
This means that the information is lost somewhere between reading and parsing the file. The data is read from the file correctly and transported to the correct vars, but is lost after parsing the file.
Reply
#4

I just did. No difference
Could this happen because I have too much variables? I'm just clueless...
Reply
#5

So there's nothing possible to do?
That's so weird... I'm just stuck.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)