20.02.2015, 11:18
If you use different interior ID's for each business, you could simply do this:
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:
And then change 200 in the loop, and in the enumerator
To MAX_BUSINESSES
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.
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
}
}
I would recommend instead of using "200", that you should do this:
pawn Код:
#define MAX_BUSINESSES 200
pawn Код:
for(new i; i < 200; i++)
new BusinessInfo[200][bInfo];
pawn Код:
for(new i; i < MAX_BUSINESSES; i++)
new BusinessInfo[MAX_BUSINESSES][bInfo];