local variable "idx" shadows a variable at a preceding level
#1

So I compile it and I get a warning of:

pawn Код:
warning 219: local variable "idx" shadows a variable at a preceding level


pawn Код:
for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
            {
                if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
                {
                    if(DoorInfo[idx][dIInt] == 83 && DoorInfo[idx][dIVW] == 8473 && BankBlock)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You can't enter the bank as it is being robbed at the moment.");
                        return 1;
                    }
                    if(DoorInfo[idx][dCInt])
                    {
                        GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
                        TogglePlayerControllable(playerid, 0);
                        SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
                        PlayerInfo[playerid][pSpawnFreeze] = 1;
                    }
                        PlayerInfo[playerid][pSpawnFreeze] = 0;
                        SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
                        SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
                        SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
                        return 1;
                    }
                }
any help please?, thanks in advance.
Reply
#2

I'm guessing it's been declared, and used more than once in the same function. Change it's name for the paticluar place, and see if you get the same errors, something like idxA idxB etc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)