28.11.2013, 22:49
(
Последний раз редактировалось Loot; 29.11.2013 в 01:16.
)
Well.. I must admit that it saves everything fine..
EDIT: looks like nothing is being loaded.. I also save string but for some weird reason it won't even load that..
(just apart of the code)
EDIT: looks like nothing is being loaded.. I also save string but for some weird reason it won't even load that..
(just apart of the code)
pawn Код:
new Float: gSomeVar[20][20][20];
TestPath(id)
{
new str[20];
format(str, sizeof(str), "/test/%d.ini", id);
return str;
}
public OnGameModeInit()
{
LoadAllTests();
return 1;
}
Save(id)
{
new str[20];
for(new a; a < 20; a++)
{
for(new c; c < 20; c++)
{
format(str, sizeof(str),"Test%d%d", a, b);
INI_WriteFloat(File, str, gSomeVar[id][a][b]);
}
}
return 1;
}
LoadAllTests()
{
for(new x = 1; x < 20; x++)
{
if(fexist(TestPath(x)))
{
INI_ParseFile(TestPath(x), "LoadTest_%s", .bExtra = true, .extra = x);
}
}
return 1;
}
forward LoadTest_data(id, name[], value[]);
public LoadTest_data(id, name[], value[])
{
new str[20];
for(new a; a < 20; a++)
{
for(new b; b < 20; b++)
{
format(str, sizeof(str),"Test%d%d", a, b);
INI_Float(str, gSomeVar[id][a][b]);
}
}
return 1;
}