[y_ini] Stats are saving, but not loading?
#1

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:
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
(The tick thingy is just a benchmark)

Loading:

PHP код:
        INI_ParseFile(file"perse_%s", .bExtra true, .extra playerid); (the file variable IS defined correctlyi have checked it 5 times.) 
PHP код:
public perse_basic(playeridname[], value[])
{
    new 
tick GetTickCount();
    new 
moneyscore;
    
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;

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?
Reply
#2

try changing

perse_%s

to

perse_basic
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)