20.02.2015, 08:30
I made a business system and when the player buy items in the market, Then I want to add money to the business but how to get the file of the business that i am in ?
new bizID;
for(new i; i<MAX_BUSINESSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, bizInfo[i][xPos], bizInfo[i][yPos], bizInfo[i][zPos]))
{
bizID = i;
break;
}
}
new InsideBiz[MAX_PLAYERS];
enum bInfo
{
bOwned,
bPrice,
bOwner[MAX_PLAYER_NAME],
bType,
bLocked,
bMoney,
Float:bEntranceX,
Float:bEntranceY,
Float:bEntranceZ,
Float:bEntranceA,
Float:bExitX,
Float:bExitY,
Float:bExitZ,
Float:bExitA,
bInt,
bWorld,
bInsideInt,
bInsideWorld,
bInsideIcon,
bOutSideIcon,
bName[128]
}
new BusinessInfo[200][bInfo];
new biz = 0;
new Float:beforeEnterX[MAX_PLAYERS];
new Float:beforeEnterY[MAX_PLAYERS];
new Float:beforeEnterZ[MAX_PLAYERS];
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
}
}
#define MAX_BUSINESSES 200
for(new i; i < 200; i++)
new BusinessInfo[200][bInfo];
for(new i; i < MAX_BUSINESSES; i++)
new BusinessInfo[MAX_BUSINESSES][bInfo];
SetPlayerVirtualWorld(playerid, 500 + business_id); // use your own value
new bizzid = GetPlayerVirtualWorld(playerid) - 500;