How could I find the error line?
#1

Code:
[debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at index 11 in array of size 11
[debug] AMX backtrace:
[debug] #0 0016c4b0 in ?? (0) in Gamemode.amx
[debug] #1 000b1c78 in public OnDialogResponse (0, 2, 1, -1, 22695856) in Gamemode.amx
This error comes to me in a specific dialogue:

pawn Code:
case DIALOG_LOGIN:
        {
            if(!response) return Kick(playerid);
            if(!strlen(inputtext)) return ShowDialog(playerid, dialogid);
           
            new password[64 + 1];
            SHA256_PassHash(inputtext, ACCOUNT_INFO[playerid][ac_SALT], password, sizeof password);
       
            if(!strcmp(password, ACCOUNT_INFO[playerid][ac_PASS], false))
            {
                LoadCharacterData(playerid);
                LoadPlayerBankAccountData(playerid);
                LoadPlayerToysData(playerid);
                LoadPlayerPocketData(playerid);
                LoadPlayerPhoneData(playerid);
                LoadPlayerGPSData(playerid);
                LoadPlayerObjectsData(playerid);
                LoadPlayerVehicles(playerid);
                LoadPlayerSkills(playerid);
                LoadPlayerWorks(playerid);
                LoadPlayerMisc(playerid);
                LoadPlayerWeaponsData(playerid);
                LoadPlayerCrewInfo(playerid);
               
                SetPlayerScore(playerid, ACCOUNT_INFO[playerid][ac_LEVEL]);
                PLAYER_TEMP[playerid][pt_DOUBT_CHANNEL_TIME] = gettime();
                ResetPlayerWeapons(playerid);
                ResetPlayerMoney(playerid);
                GivePlayerMoney(playerid, CHARACTER_INFO[playerid][ch_CASH]);
                SetPlayerFightingStyle(playerid, CHARACTER_INFO[playerid][ch_FIGHT_STYLE]);
                SetPlayerHealthEx(playerid, CHARACTER_INFO[playerid][ch_HEALTH]);
                SetPlayerArmourEx(playerid, CHARACTER_INFO[playerid][ch_ARMOUR]);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerNormalColor(playerid);
                StopAudioStreamForPlayer(playerid);
                SetSpawnInfo(playerid, NO_TEAM, CHARACTER_INFO[playerid][ch_SKIN], CHARACTER_INFO[playerid][ch_POS][0], CHARACTER_INFO[playerid][ch_POS][1], CHARACTER_INFO[playerid][ch_POS][2], CHARACTER_INFO[playerid][ch_ANGLE], 0, 0, 0, 0, 0, 0);
                SetPlayerInterior(playerid, CHARACTER_INFO[playerid][ch_INTERIOR]);
               
                PLAYER_TEMP[playerid][pt_BAD_LOGIN_ATTEMP] = 0;
                TogglePlayerSpectatingEx(playerid, false);
                TogglePlayerControllableEx(playerid, false);
                SendClientMessageEx(playerid, -1,"ЎHello {e53c3c}%s!, {FFFFFF} last connection: %s.", PLAYER_TEMP[playerid][pt_RP_NAME], ACCOUNT_INFO[playerid][ac_LAST_CONNECTION]);
            }
            else
            {
                PLAYER_TEMP[playerid][pt_BAD_LOGIN_ATTEMP] ++;
                if(PLAYER_TEMP[playerid][pt_BAD_LOGIN_ATTEMP] > MAX_BAD_LOGIN_ATTEMPS) return Kick(playerid);
                ShowDialog(playerid, dialogid);
            }
            return 1;
        }
Reply


Messages In This Thread
How could I find the error line? - by KaliDobrev - 21.02.2019, 04:44
Re: How could I find the error line? - by Calisthenics - 21.02.2019, 08:10
Re: How could I find the error line? - by KaliDobrev - 21.02.2019, 16:09
Re: How could I find the error line? - by Calisthenics - 21.02.2019, 20:00
Re: How could I find the error line? - by KaliDobrev - 21.02.2019, 22:10

Forum Jump:


Users browsing this thread: 1 Guest(s)