Yini Problem +REP
#1

Why Do I always see this in the logs?:

[22:05:55] [debug] Run time error 4: "Array index out of bounds"
[22:05:55] [debug] Accessing element at negative index -1
[22:05:55] [debug] AMX backtrace:
[22:05:55] [debug] #0 000185e4 in INI_Close (INI:file=-1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_ini.inc:746
[22:05:55] [debug] #1 00024874 in public UserSaver (playerid=0) at D:\SA-MP Things\SAMP 0.3.7 R2\gamemodes\LSGW.pwn:2143
[22:05:55] [debug] #2 00071fec in public OnPlPa_OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\gamemodes\LSGW.pwn:6708
[22:05:55] [debug] #3 native CallLocalFunction () from samp03svr
[22:05:55] [debug] #4 0001fa7c in ?? (... <2 arguments>) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\whenpause.inc:125
[22:05:55] [debug] #5 0000de3c in public SSCANF_OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_hooks/impl.inc:661
[22:05:55] [debug] #6 000010ac in public Itter_OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\sscanf2.inc:229
[22:05:55] [debug] #7 native CallLocalFunction () from samp03svr
[22:05:55] [debug] #8 000008f0 in public OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\foreach.inc:643

Line 6708:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new pName2[24];
    new str[128];
    GetPlayerName(playerid, pName2, 24);
    KillTimer(UserTimer[playerid]);

    switch(reason)
        {
            case 0: format(str, 128, "%s (%d) Has Left The Server. (Timeout/Crashed)", pName2,playerid);
            case 1: format(str, 128, "%s (%d) Has Left The Server. (Leaving)", pName2,playerid);
            case 2:
            {
             format(str, 128, "%s (%d) Has Left The Server. (Kicked/Banned)", pName2,playerid);
             Info[playerid][TimesKicked] +=1;
            }
        }
    SendClientMessageToAll(0xAFAFAFAA, str);
    if(fexist(Path(playerid)))
    {
    UserSaver(playerid);
    } // 6708 Line
UserSaver:
pawn Код:
public UserSaver(playerid)
{
    if(fexist(Path(playerid)))
    {
        if(Info[playerid][Logged] == 1)
        {
            new INI:File = INI_Open(Path(playerid));
            INI_SetTag(File,"data");
            INI_WriteString(File,"Password",PlayerInfo[playerid][pPass]);
            INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
            INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
            INI_WriteInt(File,"Management",PlayerInfo[playerid][pMT]);
            INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
            INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
            INI_WriteInt(File,"Score",GetPlayerScore(playerid));
            INI_WriteInt(File,"Drugs",LPinfo[playerid][Drugs]);
            INI_WriteInt(File,"Adrenaline",LPinfo[playerid][Adre]);
            INI_WriteInt(File,"VIPLevel",Info[playerid][VIPLevel]);
            INI_WriteInt(File,"FavouriteSkin",Info[playerid][Favouriteskin]);
            INI_WriteInt(File,"FavouriteSong",Favouritesong[playerid]);
            INI_WriteInt(File,"BankMoney",BankMoney[playerid]);
            INI_WriteInt(File,"Daysalive",Daysalive[playerid]);
            INI_WriteInt(File,"Banned",Info[playerid][Banned]);
            INI_WriteInt(File,"Muted",Info[playerid][Muted]);
            INI_WriteInt(File,"MuteWarnings",Info[playerid][MuteWarnings]);
            INI_WriteInt(File,"MaxMuteWarnings",Info[playerid][MaxMuteWarnings]);
            INI_WriteInt(File,"Warnings",Info[playerid][Warnings]);
            INI_WriteInt(File,"TimesKicked",Info[playerid][TimesKicked]);
            INI_WriteInt(File,"StartingMusic",Info[playerid][StartingMusic]);
            INI_WriteInt(File,"Respect",Info[playerid][Respect]);
            INI_WriteInt(File,"AutoUseSkin",Autouseskin[playerid]);
            INI_WriteInt(File,"FightingSkill",fskillid[playerid]);
            INI_WriteInt(File,"TurfsCaptured",Turfscaptured[playerid]);
            INI_WriteInt(File,"TurfsLost",Turfslost[playerid]);
            INI_WriteInt(File,"AssistedTurfsCaptured",ATC[playerid]);
            INI_WriteInt(File,"Hours",PlayerInfo[playerid][pHours]);
            INI_WriteInt(File,"Minutes",PlayerInfo[playerid][pMins]);
            INI_WriteInt(File,"ObjectEditor",PlayerInfo[playerid][OEditor]);
            INI_WriteInt(File,"KillSounds",Info[playerid][KillSounds]);
            INI_Close(File);
            if(IsPlayerConnected(playerid))SendClientMessage(playerid, 0x00FFFFFF, "Your Stats Has Been {FFF700}Automatically{00FFFF} Saved.");
        }
    }
    return 1;
}

[22:06:04] [debug] Run time error 4: "Array index out of bounds"
[22:06:04] [debug] Accessing element at negative index -1
[22:06:04] [debug] AMX backtrace:
[22:06:04] [debug] #0 000185e4 in INI_Close (INI:file=-1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_ini.inc:746
[22:06:04] [debug] #1 000c63a4 in ?? (... <14 arguments>) at D:\SA-MP Things\SAMP 0.3.7 R2\gamemodes\LSGW.pwn:13474
[22:06:04] [debug] #2 00012fc8 in public OnPlayerEditAttachedObject (playerid=1, response=1, index=0, modelid=17079, boneid=1, Float:fOffsetX=0.77200, Float:fOffsetY=0.00000, Float:fOffsetZ=-0.00500, Float:fRotX=0.00000, Float:fRotY=0.00000, Float:fRotZ=0.00000, Float:fScaleX=1.00000, Float:fScaleY=1.00000, Float:fScaleZ=1.00100) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_hooks/impl.inc:2969
[22:06:55] [debug] Run time error 4: "Array index out of bounds"
[22:06:55] [debug] Accessing element at negative index -1

Line 13474:

pawn Код:
public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,Float:fRotX, Float:fRotY, Float:fRotZ,Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
    /*new debug_string[256+1];
    format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
        index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);*/


    SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
    SendClientMessage(playerid, 0xFFFFFFFF, "You have finished editing attachments, it has been saved to your database.");

    new file[124];
    new name[24];
    new f1[15];
    GetPlayerName(playerid,name,24);
    format(file,sizeof(file),"PlayerObjects/%s.ini",name);
    new INI:data = INI_Open(file);
    INI_SetTag(data,"Attachments");
    format(f1,15,"O_Model_%d",index);
    INI_WriteInt(data,f1,modelid);
    format(f1,15,"O_Bone_%d",index);
    INI_WriteInt(data,f1,boneid);
    format(f1,15,"O_OffX_%d",index);
    INI_WriteFloat(data,f1,fOffsetX);
    format(f1,15,"O_OffY_%d",index);
    INI_WriteFloat(data,f1,fOffsetY);
    format(f1,15,"O_OffZ_%d",index);
    INI_WriteFloat(data,f1,fOffsetZ);
    format(f1,15,"O_RotX_%d",index);
    INI_WriteFloat(data,f1,fRotX);
    format(f1,15,"O_RotY_%d",index);
    INI_WriteFloat(data,f1,fRotY);
    format(f1,15,"O_RotZ_%d",index);
    INI_WriteFloat(data,f1,fRotZ);
    format(f1,15,"O_ScaleX_%d",index);
    INI_WriteFloat(data,f1,fScaleX);
    format(f1,15,"O_ScaleY_%d",index);
    INI_WriteFloat(data,f1,fScaleY);
    format(f1,15,"O_ScaleZ_%d",index);
    INI_WriteFloat(data,f1,fScaleZ);
    INI_Close(data);
    return 1; // Line 13474
}
[23:34:33] [debug] Run time error 4: "Array index out of bounds"
[23:34:33] [debug] Accessing element at negative index -1
[23:34:33] [debug] AMX backtrace:
[23:34:33] [debug] #0 000185e4 in INI_Close (INI:file=-1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_ini.inc:746
[23:34:33] [debug] #1 000a6b70 in ?? (... <5 arguments>) at D:\SA-MP Things\SAMP 0.3.7 R2\gamemodes\LSGW.pwn:11404
[23:34:33] [debug] #2 00011724 in public OnDialogResponse (playerid=0, dialogid=20002, response=1, listitem=-1, inputtext[]=@03129bfc "27121973") at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_hooks/impl.inc:2254

Line 11404:

pawn Код:
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                    PlayerAlreadyLoggedIn[playerid] = 1;
                    PlayerAlreadyRegisteredIn[playerid] = 1;
                    F_GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid, LPinfo[playerid][Score]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Welcome To The Server!\nYou have successfully logged in!\n\n"COL_WHITE"Please Make Sure That You Have Read All Our "COL_RED"/rules"COL_WHITE".","Ok","");
                    UserTimer[playerid] = SetTimerEx("UserSaver", 100000, true, "d", playerid);
                    PlayerDays[playerid] = SetTimerEx("DaysAlive", 1380000, true, "d", playerid);
                    Minscount[playerid] = SetTimerEx("Minscounter", 60000, true, "d", playerid);
                    GetPlayerName(playerid, logplayer, MAX_PLAYER_NAME);
                    format(pmsg, sizeof(pmsg), "[LOGIN] %s (%d) Has Logged In To His Account.", logplayer, playerid);
                    SendClientMessageToAll(0x00B8C2AA, pmsg);
                    new INI:File = INI_Open(UserPath2(playerid));
                    INI_WriteString(File,"IP", ip);
                    INI_Close(File); // Line 11404
please help me.
Reply


Messages In This Thread
Yini Problem +REP - by Youssef221 - 17.07.2015, 21:52
Re: Yini Problem +REP - by Youssef221 - 23.07.2015, 14:30
Re: Yini Problem +REP - by GlobalShot - 23.07.2015, 15:05
Re: Yini Problem +REP - by xVIP3Rx - 23.07.2015, 15:20
Re: Yini Problem +REP - by Youssef221 - 24.07.2015, 07:44
Re: Yini Problem +REP - by xVIP3Rx - 24.07.2015, 13:24
Re: Yini Problem +REP - by Youssef221 - 26.07.2015, 22:52

Forum Jump:


Users browsing this thread: 2 Guest(s)