Help me understand this biz script please?
#6

Alright, I think I may have found out.

pawn Код:
new business = PlayerInfo[playerid][pBizKey];
This variable holds a ID of a business key that the player has. If that value is not -1, then we know the player owns a business, by this check
pawn Код:
if(PlayerInfo[playerid][pBizKey] == -1)
{
   SendClientMessage(playerid, COLOR_GREY, "   You do not own a business.");
   return 1;
}
Now at this point, we know they own the business with the index inside the BizInfo array of business (which is equal to PlayerInfo[playerid][pBizKey]). So, with this check
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,25.0,BizInfo[business][bInsideX],BizInfo[business][bInsideY],BizInfo[business][bInsideZ]))
We see whether or not they are within the certain range of the business they own.

So, what really checks if they have a business is the value held by PlayerInfo[playerid][pBizKey]. If it is a value other than -1, they own a business, which you can access the BizInfo array directly from with that index.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)