break and return
#10

I think i get what you mean here is an example of what id do.
pawn Код:
new goal;
for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
        {
            if(HouseInfo[h][hOwned] == 1)
            {
                if(HouseInfo[h][hRentabil] == 0)
                {
                   
                    //script
                }
                else
                {
                    //script
                }
            }
            else
            {
                 // script
            }
            goal = 1;//you would need a variable to stop the next loop
            break; // here i want to break and return to not allow next loop
        }
    }
    if(goal == 1)return 1;//if the loop found what it was looking for return 1
    for(new h = 0; h < sizeof(SBizzInfo); h++)
    {
    }
Reply


Messages In This Thread
break and return - by GaGlets(R) - 27.12.2010, 04:16
Re: break and return - by 1337connor - 27.12.2010, 04:21
Re: break and return - by GaGlets(R) - 27.12.2010, 04:25
Re: break and return - by randomkid88 - 27.12.2010, 04:32
Re: break and return - by GaGlets(R) - 27.12.2010, 04:37
Re: break and return - by randomkid88 - 27.12.2010, 04:42
Re: break and return - by GaGlets(R) - 27.12.2010, 11:48
Re: break and return - by FUNExtreme - 27.12.2010, 11:54
Re: break and return - by GaGlets(R) - 27.12.2010, 12:03
Re: break and return - by iggy1 - 27.12.2010, 12:06

Forum Jump:


Users browsing this thread: 1 Guest(s)