warning 225: unreachable code
#3

When you use return in your code, everything behind that inside the { } isn't unreachable code anymore,
So you should look where you put those lines.
Give me a sec and I will post the correct script of that.

I think this should work:
[pawn]
pawn Код:
for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(SBizzInfo[i][sbLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
                                return 1;
                            }
                            if(SBizzInfo[i][sbProducts] == 0)
                            {
                                GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
                                return 1;
                            }
                            else
                            {

                                SafeGivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
                                gSpentCash[playerid] = GetPlayerMoney(playerid);
                                SBizzInfo[i][sbProducts]--;
                                SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
                                ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
                                new dood[MAX_PLAYER_NAME];
                                GetPlayerName(playerid, dood, sizeof(dood));
                                format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
                                printf("%s", string);
                                PayLog(string);
                                OnPropUpdate();
                                return 1;
                            }
                        }
                    }
                }
            }
Reply


Messages In This Thread
warning 225: unreachable code - by dafuq - 04.10.2012, 12:30
Re: warning 225: unreachable code - by dafuq - 04.10.2012, 12:33
Re: warning 225: unreachable code - by Roel - 04.10.2012, 12:36
Re: warning 225: unreachable code - by dafuq - 04.10.2012, 12:39
Re: warning 225: unreachable code - by Roel - 04.10.2012, 12:45

Forum Jump:


Users browsing this thread: 2 Guest(s)