server crashes when using this filterscript
#1

got these errors from Crashdetect.so with House.amx right before it crashes
Код:
1:00] [debug] #0  00000c6c in OnPlayerEnterCheckpoint () from House.amx
[10:21:00] [debug] Backtrace (most recent call first):
[10:21:00] [debug] Server crashed while executing House.amx
[10:20:58] [debug] #1  00028714 in OnDialogResponse () from House.amx
[10:20:58] [debug] #0  00014d10 in ?? () from House.amx
[10:20:58] [debug] Backtrace (most recent call first):
[10:20:58] [debug]   Accessing element at negative index -1
[10:20:58] [debug] Run time error 4: "Array index out of bounds"
and here is OnPlayerEnterCheckpoint
pawn Код:
public OnPlayerEnterCheckpoint(playerid, checkpointid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        new string[256], tmpstring[50];
        foreach(Houses, h)
        {
            if(checkpointid == HouseCPOut[h])
            {
                new WantedInHouse;
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                    if(GetPVarInt(i, "LastHouseCP") == h && (GetPlayerWantedLevel(i) > 0))WantedInHouse=1;
                }
                if(IsCop(playerid))
                {
                    if(WantedInHouse==1)
                    {
                        SetPVarInt(playerid, "LastHouseCP", h);
                        if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) || GetPVarInt(playerid,"AdminMode")==1)
                        {
                            SetPlayerHouseInterior(playerid, h);
                            SendClientMessage(playerid,COLOR_CYAN,"Type /housemenu to access the house menu!");
                            break;
                        }
                        format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
                        if(GetPVarInt(playerid, tmpstring) == 1)
                        {
                            SetPlayerHouseInterior(playerid, h);
                            break;
                        }
                        if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
                        {
                            if(hInfo[h][HousePassword] == udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0: ShowInfoBox(playerid, LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
                                    case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak Down Door", "Select", "Cancel");
                                }
                                break;
                            }
                            if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak Down Door", "Select", "Cancel");
                                    case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak Down Door", "Select", "Cancel");
                                }
                                break;
                            }
                        }
                        if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE) && hInfo[h][HouseValue] > 0 && GetPVarInt(playerid, "JustCreatedHouse") == 0)
                        {
                            format(string, sizeof(string), HMENU_BUY_HOUSE, hInfo[h][HouseValue]);
                            ShowPlayerDialog(playerid, HOUSEMENU+4, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
                            break;
                        }
                    }
                    else
                    {
                        SetPVarInt(playerid, "LastHouseCP", h);
                        if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
                        {
                            SetPlayerHouseInterior(playerid, h);
                            SendClientMessage(playerid,COLOR_CYAN,"Type /housemenu to access the house menu!");
                            //ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
                            break;
                        }
                        format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
                        if(GetPVarInt(playerid, tmpstring) == 1)
                        {
                            SetPlayerHouseInterior(playerid, h);
                            break;
                        }
                        if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
                        {
                            if(hInfo[h][HousePassword] == udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0: ShowInfoBox(playerid, LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
                                    case 1:
                                    {
                                        switch(hInfo[h][HousePrivacy])
                                        {
                                            case 0: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)", "Select", "Cancel");
                                            case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nEnter House", "Select", "Cancel");
                                        }
                                    }
                                }
                                break;
                            }
                            if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0:
                                    {
                                        switch(hInfo[h][HousePrivacy])
                                        {
                                            case 0: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password", "Select", "Cancel");
                                            case 1: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nEnter House", "Select", "Cancel");
                                        }
                                    }
                                    case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nEnter House", "Select", "Cancel");
                                }
                                break;
                            }
                        }
                        if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE) && hInfo[h][HouseValue] > 0 && GetPVarInt(playerid, "JustCreatedHouse") == 0)
                        {
                            format(string, sizeof(string), HMENU_BUY_HOUSE, hInfo[h][HouseValue]);
                            ShowPlayerDialog(playerid, HOUSEMENU+4, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
                            break;
                        }
                    }
                }
                else
                {
                    if(IsCop(playerid))
                    {
                        SetPVarInt(playerid, "LastHouseCP", h);
                        if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
                        {
                            SetPlayerHouseInterior(playerid, h);
                            SendClientMessage(playerid,COLOR_CYAN,"Type /housemenu to access the house menu!");
                            //ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
                            break;
                        }
                        format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
                        if(GetPVarInt(playerid, tmpstring) == 1)
                        {
                            SetPlayerHouseInterior(playerid, h);
                            break;
                        }
                        if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
                        {
                            if(hInfo[h][HousePassword] == udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0: ShowInfoBox(playerid, LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
                                    case 1:
                                    {
                                        switch(hInfo[h][HousePrivacy])
                                        {
                                            case 0: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)", "Select", "Cancel");
                                            case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nEnter House", "Select", "Cancel");
                                        }
                                    }
                                }
                                break;
                            }
                            if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0:
                                    {
                                        switch(hInfo[h][HousePrivacy])
                                        {
                                            case 0: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password", "Select", "Cancel");
                                            case 1: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nEnter House", "Select", "Cancel");
                                        }
                                    }
                                    case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nEnter House", "Select", "Cancel");
                                }
                                break;
                            }
                        }
                        if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE) && hInfo[h][HouseValue] > 0 && GetPVarInt(playerid, "JustCreatedHouse") == 0)
                        {
                            format(string, sizeof(string), HMENU_BUY_HOUSE, hInfo[h][HouseValue]);
                            ShowPlayerDialog(playerid, HOUSEMENU+4, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
                            break;
                        }
                    }
                    else
                    {
                        SetPVarInt(playerid, "LastHouseCP", h);
                        if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
                        {
                            SetPlayerHouseInterior(playerid, h);
                            SendClientMessage(playerid,COLOR_CYAN,"Type /housemenu to access the house menu!");
                            //ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
                            break;
                        }
                        format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
                        if(GetPVarInt(playerid, tmpstring) == 1)
                        {
                            SetPlayerHouseInterior(playerid, h);
                            break;
                        }
                        if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
                        {
                            if(hInfo[h][HousePassword] == udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0: ShowInfoBox(playerid, LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
                                    case 1:
                                    {
                                        switch(hInfo[h][HousePrivacy])
                                        {
                                            case 0: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In", "Select", "Cancel");
                                            case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In\nEnter House", "Select", "Cancel");
                                        }
                                    }
                                }
                                break;
                            }
                            if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
                            {
                                switch(hInfo[h][ForSale])
                                {
                                    case 0:
                                    {
                                        switch(hInfo[h][HousePrivacy])
                                        {
                                            case 0: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak In", "Select", "Cancel");
                                            case 1: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak In\nEnter House", "Select", "Cancel");
                                        }
                                    }
                                    case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In\nEnter House", "Select", "Cancel");
                                }
                                break;
                            }
                        }
                        if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE) && hInfo[h][HouseValue] > 0 && GetPVarInt(playerid, "JustCreatedHouse") == 0)
                        {
                            format(string, sizeof(string), HMENU_BUY_HOUSE, hInfo[h][HouseValue]);
                            ShowPlayerDialog(playerid, HOUSEMENU+4, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
                            break;
                        }
                    }
                }
            }
            if(checkpointid == HouseCPInt[h])
            {
                switch(GetPVarInt(playerid, "HousePreview"))
                {
                    case 0: ExitHouse(playerid, h);
                    #if GH_HINTERIOR_UPGRADE == true
                    case 1:
                    {
                        GetPVarString(playerid, "HousePrevName", tmpstring, 50);
                        format(string, sizeof(string), HMENU_BUY_HINTERIOR, tmpstring, GetPVarInt(playerid, "HousePrevValue"));
                        ShowPlayerDialog(playerid, HOUSEMENU+17, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
                    }
                    #endif
                }
                break;
            }
        }
    }
    return 1;
}
Reply
#2

Look for the OnDialogResponse part of the FS and post it here, that's where the debug is showing the error.
Reply
#3

alright, heres most of OnDialogResponse the whole ondialogresponse is about 1400 lines but this is the only thing I have edited since it last worked.


pawn Код:
if(dialogid == HOUSEMENU+23 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                format(string,sizeof(string), HSELL_BUY_DIALOG, hInfo[h][HouseOwner], hInfo[h][HouseName], hInfo[h][ForSalePrice]);
                ShowPlayerDialog(playerid, HOUSEMENU+22, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
            }
            case 1:
            {
                #if GH_ALLOW_BREAKIN == false
                    ShowInfoBoxEx(playerid, COLOUR_INFO, E_NO_HOUSE_BREAKIN);
                #else
               
                new WantedInHouse;
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                    if(GetPVarInt(i, "LastHouseCP") == h && (GetPlayerWantedLevel(i) > 0))WantedInHouse=1;
                }
                if(IsCop(playerid) && (WantedInHouse==1))
                {
                    SetPlayerHouseInterior(playerid, h);
                }
                else
                {
                    new breakintime = GetPVarInt(playerid, "TimeSinceHouseBreakin"), houseowner = GetHouseOwnerEx(h), bi_chance = random(10000);
                    if(GetSecondsBetweenAction(breakintime) < (TIME_BETWEEN_BREAKINS * 60000) && breakintime != 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_WAIT_BEFORE_BREAKIN);
                    SetPVarInt(playerid, "TimeSinceHouseBreakin", GetTickCount());
                    if((hInfo[h][UpgradedLock] == 0 && bi_chance < 7000) ||  (hInfo[h][UpgradedLock] == 1 && bi_chance < 9000))
                    {
                        if(IsPlayerConnected(houseowner))
                        {
                            switch(hInfo[h][HouseCamera])
                            {
                                case 0:
                                {
                                    if(hInfo[h][HouseAlarm] == 1)
                                    {
                                        ShowInfoBox(houseowner, E_FAILED_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                                    }
                                }
                                case 1: ShowInfoBox(houseowner, E_FAILED_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                            }
                        }
                        ShowInfoBox(playerid, E_FAILED_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
                        SecurityDog_Bite(playerid, h, 0, 1);
                    }
                    if((hInfo[h][UpgradedLock] == 0 && bi_chance >= 7000) ||  (hInfo[h][UpgradedLock] == 1 && bi_chance >= 9000))
                    {
                        if(IsPlayerConnected(houseowner))
                        {
                            switch(hInfo[h][HouseCamera])
                            {
                                case 0:
                                {
                                    if(hInfo[h][HouseAlarm] == 1)
                                    {
                                        ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                                    }
                                }
                                case 1: ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                            }
                        }
                        ShowInfoBox(playerid, I_SUCCESSFULL_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
                        SetPlayerHouseInterior(playerid, h);
                    }
                    #if GH_GIVE_WANTEDLEVEL == true
                    if((GetPlayerWantedLevel(playerid) + HBREAKIN_WL) > GH_MAX_WANTED_LEVEL)
                    {
                        SetPlayerWantedLevel(playerid, GH_MAX_WANTED_LEVEL);
                    }
                    else SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + HBREAKIN_WL));
                    #endif
                }
                #endif
            }
            case 2:
            {
                if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
                {
                    format(string, sizeof(string), HMENU_ENTER_PASS, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
                    ShowPlayerDialog(playerid, HOUSEMENU+60, DIALOG_STYLE_INPUT, INFORMATION_HEADER, string, "Enter", "Close");
                }
                else SetPlayerHouseInterior(playerid, h);
            }
        }
        return 1;
    }
//------------------------------------------------------------------------------
    if(dialogid == HOUSEMENU+28 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
                {
                    format(string,sizeof(string), HMENU_ENTER_PASS, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
                    ShowPlayerDialog(playerid, HOUSEMENU+60, DIALOG_STYLE_INPUT, INFORMATION_HEADER, string, "Enter", "Close");
                }
            }
            case 1:
            {
                #if GH_ALLOW_BREAKIN == false
                    ShowInfoBoxEx(playerid, COLOUR_INFO, E_NO_HOUSE_BREAKIN);
                #else
                new WantedInHouse;
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                    if(GetPVarInt(i, "LastHouseCP") == h && (GetPlayerWantedLevel(i) > 0))WantedInHouse=1;
                }
                if(IsCop(playerid) && (WantedInHouse==1))
                {
                    SetPlayerHouseInterior(playerid, h);
                }
                else
                {
                    new breakintime = GetPVarInt(playerid, "TimeSinceHouseBreakin"), houseowner = GetHouseOwnerEx(h), bi_chance = random(10000);
                    if(GetSecondsBetweenAction(breakintime) < (TIME_BETWEEN_BREAKINS * 60000) && breakintime != 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_WAIT_BEFORE_BREAKIN);
                    SetPVarInt(playerid, "TimeSinceHouseBreakin", GetTickCount());
                    if((hInfo[h][UpgradedLock] == 0 && bi_chance < 7000) ||  (hInfo[h][UpgradedLock] == 1 && bi_chance < 9000))
                    {
                        if(IsPlayerConnected(houseowner))
                        {
                            switch(hInfo[h][HouseCamera])
                            {
                                case 0:
                                {
                                    if(hInfo[h][HouseAlarm] == 1)
                                    {
                                        ShowInfoBox(houseowner, E_FAILED_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                                    }
                                }
                                case 1: ShowInfoBox(houseowner, E_FAILED_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                            }
                        }
                        ShowInfoBox(playerid, E_FAILED_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
                        SecurityDog_Bite(playerid, h, 0, 1);
                    }
                    if((hInfo[h][UpgradedLock] == 0 && bi_chance >= 7000) ||  (hInfo[h][UpgradedLock] == 1 && bi_chance >= 9000))
                    {
                        if(IsPlayerConnected(houseowner))
                        {
                            switch(hInfo[h][HouseCamera])
                            {
                                case 0:
                                {
                                    if(hInfo[h][HouseAlarm] == 1)
                                    {
                                        ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                                    }
                                }
                                case 1: ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
                            }
                        }
                        ShowInfoBox(playerid, I_SUCCESSFULL_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
                        SetPlayerHouseInterior(playerid, h);
                    }
                    #if GH_GIVE_WANTEDLEVEL == true
                    if((GetPlayerWantedLevel(playerid) + HBREAKIN_WL) > GH_MAX_WANTED_LEVEL)
                    {
                        SetPlayerWantedLevel(playerid, GH_MAX_WANTED_LEVEL);
                    }
                    else SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + HBREAKIN_WL));
                    #endif
                }
                #endif
            }
            case 2: SetPlayerHouseInterior(playerid, h);
        }
        return 1;
    }
Reply
#4

Any help at all would be great
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)