23.02.2013, 09:44
Hi. Lately i have been interested in finally doing it and moving to y_ini. The problem is, that the script saves the stats correctly, and when i open the file it has the things in it. When i try to load the stats (With parsefile), however, they are not loading. My script for it is the following:
Saving:
(The tick thingy is just a benchmark)
Loading:
What am i doing wrong?
EDIT: I would like to add, that the printf is never showing up in the console, so the callback isn't even being called?
Saving:
PHP код:
new tick = GetTickCount();
new INI:iniFile = INI_Open(file);
//
// y_ini supports tags, that is:
//
// [tag]
// key = value
//
INI_SetTag(iniFile, "basic");
// Write an integer value with the key "some_integer" under the current tag:
INI_WriteInt(iniFile, "AdminLevel", AdminLevel[playerid]);
INI_WriteInt(iniFile, "Language", pLanguage[playerid]);
INI_WriteInt(iniFile, "Money", GetPlayerMoney(playerid));
INI_WriteInt(iniFile, "Autorepair", pAutoRepair[playerid]);
INI_WriteInt(iniFile, "Score", GetPlayerScore(playerid));
// Now close the current file:
INI_Close(iniFile);
printf("Statsien tallennus Y_INIllд: %d millisekuntia.",GetTickCount()-tick);
return 1;
Loading:
PHP код:
INI_ParseFile(file, "perse_%s", .bExtra = true, .extra = playerid); (the file variable IS defined correctly, i have checked it 5 times.)
PHP код:
public perse_basic(playerid, name[], value[])
{
new tick = GetTickCount();
new money, score;
INI_Int("AdminLevel", AdminLevel[playerid]);
INI_Int("Language", pLanguage[playerid]);
INI_Int("Money", money);
INI_Int("Autorepair", pAutoRepair[playerid]);
INI_Int("Score", score);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,money);
SetPlayerScore(playerid,score);
printf("Statsien lataus Y_INIllд: %d millisekuntia.",GetTickCount()-tick);
return 1;
}
EDIT: I would like to add, that the printf is never showing up in the console, so the callback isn't even being called?