[DUDA] unreachable code
#1

Hay alguna forma de solucionarlo?
Reply
#2

Eso sale cuando tratas de hacer algo fuera de la sintaxis de pawn, pasa el ultimo code que agregaste/modificaste.
Reply
#3

Codigo con error:
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~Cerrado", 5000, 1);
                                return 1;
                            }
                            if(SBizzInfo[i][sbProducts] == 0)
                            {
                                GameTextForPlayer(playerid, "~r~Agotado", 5000, 1);
                                return 1;
                            }
                            else
                            {
                                return 1;
                            }
                            GivePlayerMoneyGR(playerid,-SBizzInfo[i][sbEntranceCost]);//error aca
                            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();
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
                    }
                }
            }
Codigo original:
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~Cerrado", 5000, 1);
                                return 1;
                            }
                            if(SBizzInfo[i][sbProducts] == 0)
                            {
                                GameTextForPlayer(playerid, "~r~Agotado", 5000, 1);
                                return 1;
                            }
                            if(i == 10)
                            {
                                PaintballPlayers ++;
                                PlayerPaintballing[playerid] = 1;
                                new rand = random(sizeof(PaintballSpawns));
                                SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
                                TogglePlayerControllable(playerid, 0);
                            }
                            else if(i == 11)
                            {
                                PlayerKarting[playerid] = 1;
                                SendClientMessage(playerid, TEAM_GROVE_COLOR, "You can now parcipitate in a Karting Race, grab a Kart.");
                            }
                            else
                            {
                                return 1;
                            }
                            GivePlayerMoneyGR(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();
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
                    }
                }
            }
Quise sacar lo de los kartings (estoy limpiando el gm de boludeces)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)