loop [REP++]
#6

If you use different interior ID's for each business, you could simply do this:
pawn Код:
for(new i; i < 200; i++) // Loops through the number "200"
{
    if(GetPlayerInterior(playerid) == BusinessInfo[i][bInsideInt]) // Checks if the player's Interior ID is the same as the Business's Interior ID
    {
        InsideBiz[playerid] = i; // Sets the "InsideBiz" value to the number that he had the same interior ID as
        break; // Stops the loop once this is found
    }
}
Where "InsideBiz" will be set to the business ID the player is inside of.
I would recommend instead of using "200", that you should do this:
pawn Код:
#define MAX_BUSINESSES 200
And then change 200 in the loop, and in the enumerator
pawn Код:
for(new i; i < 200; i++)
new BusinessInfo[200][bInfo];
To MAX_BUSINESSES
pawn Код:
for(new i; i < MAX_BUSINESSES; i++)
new BusinessInfo[MAX_BUSINESSES][bInfo];
With this method, you can easily change the Businesses limit by changing the #define, otherwise you have to check through all your code for the "200"'s and change them to a new limit each time you wanna change it.
Reply


Messages In This Thread
loop [REP++] - by nezo2001 - 20.02.2015, 08:30
Re: loop [REP++] - by Schneider - 20.02.2015, 10:18
Re: loop [REP++] - by nezo2001 - 20.02.2015, 10:37
Re: loop [REP++] - by CalvinC - 20.02.2015, 10:43
Re: loop [REP++] - by nezo2001 - 20.02.2015, 10:59
Re: loop [REP++] - by CalvinC - 20.02.2015, 11:18
Re: loop [REP++] - by nezo2001 - 20.02.2015, 11:51
Re: loop [REP++] - by CalvinC - 20.02.2015, 12:12
Re: loop [REP++] - by DaniceMcHarley - 20.02.2015, 12:14
Re: loop [REP++] - by dominik523 - 20.02.2015, 13:50

Forum Jump:


Users browsing this thread: 6 Guest(s)