INI_Close (INI:file=-1)
#1

Upon /q these errors are detected by crashdetector

Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at negative index -1
[debug] AMX backtrace:
[debug] #0 0001a720 in INI_Close (INI:file=-1) at pawno\include\YSI\y_ini.inc:746
[debug] #1 000a6698 in ?? (... <2 arguments>) at gamemodes\sabp.pwn:6431
[debug] #2 0000ff80 in public SSCANF_OnPlayerDisconnect (playerid=1, reason=1) at pawno\include\YSI\y_hooks/impl.inc:661
[debug] #3 000035a0 in public Streamer_OnPlayerDisconnect (playerid=1, reason=1) at pawno\include\sscanf2.inc:229
 [debug] #4 00002dd0 in public Itter_OnPlayerDisconnect (playerid=1, reason=1) at pawno\include\streamer.inc:325
 [debug] #5 00002668 in public OnPlayerDisconnect (playerid=1, reason=1) at pawno\include\YSI\y_iterate.inc:909
pawn Код:
[04:31:39] [join] fucme has joined the server (1:6.6.6)
[04:31:39] *** IRC_OnUserSay (Bot ID 1): User Mexican (ServerBot2@sabp.mexicans.are.taking.over) sent message to #sabp.echo: 02[1] 03*** fucme has joined the server.
[04:31:48] [chat] [fucme]: ttw
[04:31:49] [chat] [fucme]: we
[04:31:49] *** IRC_OnUserSay (Bot ID 1): User Mexican (ServerBot2@sabp.mexicans.are.taking.over) sent message to #sabp.echo: (Mexican) fucme[1]: we
[04:31:49] [chat] [fucme]: twe
[04:31:50] Player: fucme(1) has quit. His File DOES exist: sa-bp/Accounts/fucme.ini
[04:31:50] [debug] Run time error 4: "Array index out of bounds"
[04:31:50] [debug]  Accessing element at negative index -1
[04:31:50] [debug] AMX backtrace:
[04:31:50] [debug] #0 0001a720 in INI_Close (INI:file=-1) at C:\Users\student\Desktop\Project\SABP Beta 0.3\SABP Beta 0.3\pawno\include\YSI\y_ini.inc:746
[04:31:50] [debug] #1 000a6698 in ?? (... <2 arguments>) at C:\Users\student\Desktop\Project\SABP Beta 0.3\SABP Beta 0.3\gamemodes\sabp.pwn:6431
[04:31:50] [debug] #2 0000ff80 in public SSCANF_OnPlayerDisconnect (playerid=1, reason=1) at C:\Users\student\Desktop\Project\SABP Beta 0.3\SABP Beta 0.3\pawno\include\YSI\y_hooks/impl.inc:661
[04:31:50] [debug] #3 000035a0 in public Streamer_OnPlayerDisconnect (playerid=1, reason=1) at C:\Users\student\Desktop\Project\SABP Beta 0.3\SABP Beta 0.3\pawno\include\sscanf2.inc:229
[04:31:50] [debug] #4 00002dd0 in public Itter_OnPlayerDisconnect (playerid=1, reason=1) at C:\Users\student\Desktop\Project\SABP Beta 0.3\SABP Beta 0.3\pawno\include\streamer.inc:325
[04:31:50] [debug] #5 00002668 in public OnPlayerDisconnect (playerid=1, reason=1) at C:\Users\student\Desktop\Project\SABP Beta 0.3\SABP Beta 0.3\pawno\include\YSI\y_iterate.inc:909
[04:31:50] [part] fucme has left the server (1:1)
[04:31:51] *** IRC_OnUserSay (Bot ID 1): User Mexican (ServerBot2@sabp.mexicans.are.taking.over) sent message to #sabp.echo: 02[1] 03*** fucme has left the server. (Leaving)
What could cause INI_Close to return -1?

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new string[128];
    if(fexist(userpath(playerid)))
    {
        format(string, sizeof(string), "Player: %s(%i) has quit. His File DOES exist: %s", Name(playerid), playerid, userpath(playerid));
        print(string);
    }
    else if(!fexist(userpath(playerid)))
    {
        format(string, sizeof(string), "Player: %s(%i) has quit. His File DOES NOT exist", Name(playerid), playerid);
        print(string);
    }
    for(new i=0; i < 6; i++)
    {
        GetPlayerWeaponData(playerid, i, Info[playerid][WeaponSlot][i], Info[playerid][WeaponSlot_Ammo][i]);
    }
   
   
    new pstring[16];
    format(pstring, sizeof(pstring),"%s",GetPlayerIp(playerid, pstring, sizeof(pstring)));
    new INI:File = INI_Open(userpath(playerid));
    INI_WriteInt(File,"Admin",Info[playerid][aLevel]);
    INI_WriteInt(File,"VIP",Info[playerid][vLevel]);
    INI_WriteInt(File,"CitySpawn",Info[playerid][CitySpawn]);
    INI_WriteInt(File,"SpawnInHouse",Info[playerid][SpawnInHouse]);
    INI_WriteInt(File,"Seconds",Info[playerid][Seconds]);
    INI_WriteInt(File,"Minutes",Info[playerid][Minutes]);
    INI_WriteInt(File,"Hours",Info[playerid][Hours]);
    INI_WriteInt(File,"Money",GetPlayerCash(playerid));
    INI_WriteInt(File,"BankCash",Info[playerid][BankCash]);
    INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    INI_WriteInt(File,"Seeds",Info[playerid][Seeds]);
    INI_WriteInt(File,"Grams",Info[playerid][Grams]);
    INI_WriteInt(File,"Kills",Info[playerid][Kills]);
    INI_WriteInt(File,"Deaths",Info[playerid][Deaths]);
    INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
    INI_WriteInt(File,"Team",Info[playerid][Team]);
    INI_WriteString(File,"IP",pstring);
    INI_WriteInt(File,"TruckMCompleted",Info[playerid][TruckMCompleted]);
    INI_WriteInt(File,"LastVehicle",Info[playerid][LastVehicle]);
    INI_WriteInt(File,"Wanted_Level",GetPlayerWantedLevel(playerid));
    INI_WriteInt(File,"WeaponSlot1",Info[playerid][WeaponSlot][0]);
    INI_WriteInt(File,"WeaponSlot1_Ammo",Info[playerid][WeaponSlot_Ammo][0]);
    INI_WriteInt(File,"WeaponSlot2",Info[playerid][WeaponSlot][1]);
    INI_WriteInt(File,"WeaponSlot2_Ammo",Info[playerid][WeaponSlot_Ammo][1]);
    INI_WriteInt(File,"WeaponSlot3",Info[playerid][WeaponSlot][2]);
    INI_WriteInt(File,"WeaponSlot3_Ammo",Info[playerid][WeaponSlot_Ammo][2]);
    INI_WriteInt(File,"WeaponSlot4",Info[playerid][WeaponSlot][3]);
    INI_WriteInt(File,"WeaponSlot4_Ammo",Info[playerid][WeaponSlot_Ammo][3]);
    INI_WriteInt(File,"WeaponSlot5",Info[playerid][WeaponSlot][4]);
    INI_WriteInt(File,"WeaponSlot5_Ammo",Info[playerid][WeaponSlot_Ammo][4]);
    INI_WriteInt(File,"WeaponSlot6",Info[playerid][WeaponSlot][5]);
    INI_WriteInt(File,"WeaponSlot6_Ammo",Info[playerid][WeaponSlot_Ammo][5]);
    INI_Close(File);
Reply


Messages In This Thread
INI_Close (INI:file=-1) - by SnG.Scot_MisCuDI - 04.02.2015, 08:47
Re: INI_Close (INI:file=-1) - by PaulDinam - 04.02.2015, 09:49
Re: INI_Close (INI:file=-1) - by SnG.Scot_MisCuDI - 04.02.2015, 18:59
Re: INI_Close (INI:file=-1) - by Sime30 - 04.02.2015, 19:40
Re: INI_Close (INI:file=-1) - by SnG.Scot_MisCuDI - 04.02.2015, 19:59
Re: INI_Close (INI:file=-1) - by Sime30 - 04.02.2015, 20:51
Re: INI_Close (INI:file=-1) - by SnG.Scot_MisCuDI - 04.02.2015, 20:56
Re: INI_Close (INI:file=-1) - by Sime30 - 04.02.2015, 21:05
Re: INI_Close (INI:file=-1) - by SnG.Scot_MisCuDI - 04.02.2015, 21:13
Re: INI_Close (INI:file=-1) - by SnG.Scot_MisCuDI - 05.02.2015, 08:09

Forum Jump:


Users browsing this thread: 1 Guest(s)