Please fix with this ERORR !
#6

I looked every line (yeah, 1611 lines) and I came up with 2 results.

pawn Код:
// first:
            case CHECKPOINT_HOME:
            {
                PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                new i = hInviteHouse[playerid];
                DisablePlayerCheckpoint(playerid);
                gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
                SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
                SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
                PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
                PlayerInfo[playerid][pVW] = i+6000;
                SetPlayerVirtualWorld(playerid, i+6000);
                if(HouseInfo[i][hCustomInterior] == 1) Player_StreamPrep(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ], FREEZE_TIME);
                hInviteOffer[playerid] = INVALID_PLAYER_ID;
                hInviteHouse[playerid] = -1;
            }
pawn Код:
// second:
                new mypoint = -1;
                for (new i=0; i<MAX_POINTS; i++)
                {
                    if(strcmp(Points[i][Name], "San Fierro Docks", true) == 0)
                    {
                        mypoint = i;
                    }
                }
                for(new i = 0; i < sizeof(FamilyInfo); i++)
                {
                    if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
                    {
                        Tax -= 200;
                        Misc_Save();
                        FamilyInfo[i][FamilyBank] = FamilyInfo[i][FamilyBank]+(200);
                    }
                }
On the first one, in case hInviteHouse[playerid] is -1 it will give that runtime error because it pass the i into HouseInfo.

On the second one (and most likely the one which caused the crash), you set mypoint to -1. If none of the points' name match with "San Fierro Docks", mypoint will be still -1 and then you pass it into Points.

The solution for them is to check if they're not -1 in order to prevent it. I hope I didn't miss any other part of the code.

pawn Код:
// first:
            case CHECKPOINT_HOME:
            {
                PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                new i = hInviteHouse[playerid];
                if(i != -1)
                {
                    DisablePlayerCheckpoint(playerid);
                    gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
                    SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
                    SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                    GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
                    PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
                    PlayerInfo[playerid][pVW] = i+6000;
                    SetPlayerVirtualWorld(playerid, i+6000);
                    if(HouseInfo[i][hCustomInterior] == 1) Player_StreamPrep(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ], FREEZE_TIME);
                    hInviteOffer[playerid] = INVALID_PLAYER_ID;
                    hInviteHouse[playerid] = -1;
                }
            }
pawn Код:
// second:
                new mypoint = -1;
                for (new i=0; i<MAX_POINTS; i++)
                {
                    if(strcmp(Points[i][Name], "San Fierro Docks", true) == 0)
                    {
                        mypoint = i;
                    }
                }
                for(new i = 0; i < sizeof(FamilyInfo); i++)
                {
                    if(mypoint != -1)
                    {
                        if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
                        {
                            Tax -= 200;
                            Misc_Save();
                            FamilyInfo[i][FamilyBank] = FamilyInfo[i][FamilyBank]+(200);
                        }
                    }
                }
Reply


Messages In This Thread
Please fix with this ERORR ! - by nguyenquynh - 16.10.2013, 10:12
Re: Please fix with this ERORR ! - by Konstantinos - 16.10.2013, 10:18
Re: Please fix with this ERORR ! - by nguyenquynh - 16.10.2013, 10:25
Re: Please fix with this ERORR ! - by Konstantinos - 16.10.2013, 10:30
Re: Please fix with this ERORR ! - by nguyenquynh - 16.10.2013, 10:34
Re: Please fix with this ERORR ! - by Konstantinos - 16.10.2013, 11:13
Re: Please fix with this ERORR ! - by nguyenquynh - 16.10.2013, 11:36

Forum Jump:


Users browsing this thread: 1 Guest(s)