My problems with Y_INI
#1

Here is my parse file
pawn Код:
if(fexist(GetPath(playerid)))
        {
            new string[80];
            format(string,sizeof(string),"Sveiki sugrįћę %s, jūs automatiљkai buvote prijungtas",Name);
            SendClientMessage(playerid,0xFFFF00FF,string);
            INI_ParseFile(GetPath(playerid),"LoadStats_%s", .bExtra = true, .extra = playerid);
           
        }
Here is my LoadStats:
pawn Код:
forward LoadStats_data(playerid, name[], value[]);
public LoadStats_data(playerid,name[],value[])
{
    new temp[128];
    INI_String("Password",temp,128); format(PlayerInfo[playerid][pPass],sizeof(temp),temp);
    INI_Int("AdminLevel",PlayerInfo[playerid][AdminLevel]);
    INI_Int("XP",PlayerInfo[playerid][XP]);
    INI_Int("Money",PlayerInfo[playerid][Money]);
    INI_Int("Kills",PlayerInfo[playerid][Kills]);
    INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
    SetPlayerScore(playerid,PlayerInfo[playerid][XP]);
    GivePlayerMoney(playerid,PlayerInfo[playerid][Money]);
    printf("Done:pinigai %d",PlayerInfo[playerid][Money]);
    return 1;
}
Well the problem is, it loads "AdminLevel" alright,it loads "XP" aswell, but with money it's different,it just doesn't load it. The printf there prints 0. Although in the file it's not 0

My other problem:
pawn Код:
stock SaveStats(playerid)
{
    new INI:file = INI_Open(GetPath(playerid));
    INI_SetTag(file,"Player's Data");
    INI_WriteInt(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
    INI_WriteInt(file,"XP",PlayerInfo[playerid][XP]);
    INI_WriteInt(file,"Money",PlayerInfo[playerid][Money]);
    INI_WriteInt(file,"Kills",PlayerInfo[playerid][Kills]);
    INI_WriteInt(file,"Deaths",PlayerInfo[playerid][Deaths]);
    INI_Close(file);
    return 1;
}
When i use it in my command which uses that function "SaveStats" it outputs this weird warning:
pawn Код:
[10:18:03] [debug] Run time error 4: "Array index out of bounds"
[10:18:03] [debug]  Accessing element at index 14 past array upper bound 12
[10:18:03] [debug] AMX backtrace:
[10:18:03] [debug] #0 000194fc in public cmd_test () from GangWars.amx
[10:18:03] [debug] #1 native CallLocalFunction () [00471e90] from samp-server.exe
[10:18:03] [debug] #2 00000530 in public OnPlayerCommandText () from GangWars.amx
Any feedback will be appreciated
Reply


Messages In This Thread
My problems with Y_INI - by dusk - 14.04.2013, 07:00
Re: My problems with Y_INI - by DiGiTaL_AnGeL - 14.04.2013, 08:03
Re: My problems with Y_INI - by dusk - 14.04.2013, 08:11
Respuesta: My problems with Y_INI - by Nabeshin - 14.04.2013, 08:15
Re: Respuesta: My problems with Y_INI - by DiGiTaL_AnGeL - 14.04.2013, 08:23
Re: My problems with Y_INI - by dusk - 14.04.2013, 11:23

Forum Jump:


Users browsing this thread: 1 Guest(s)