pawn Код:
new InsideBiz;[MAX_PLAYERS]//This define will be used later to find out what business we are in.
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];//We are creating a define to use for our Enum.
BizID// You'll also have to save this, and load this..I expect you know how to do this.
new str[40];
for(new idx = 1; idx < sizeof(BusinessInfo); idx++)//Creates a loop, that goes through all of the businesses.
{
format(str, sizeof(str), BPATH, idx);//formats the file path, with the biz ID
INI_ParseFile(str, "loadbiz_%s", .bExtra = true, .extra = idx );//This is very hard to explain, but it basically loads the info from the file(More in ****** y_ini tutorial.)
BusinessInfo[idx][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bEntranceX], BusinessInfo[idx][bEntranceY], BusinessInfo[idx][bEntranceZ], BusinessInfo[idx][bWorld]); //Creates a pickup at the business entrance.
BusinessInfo[idx][bInsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bExitX], BusinessInfo[idx][bExitY], BusinessInfo[idx][bExitZ], BusinessInfo[idx][bInsideWorld]); //Creates a pickup at the exit(Inside the interior)
}
for(new id = 1; id < sizeof(BusinessInfo); id++)//Loops through the businesses.
{
if(BusinessInfo[id][bPrice] == 0) break;//Breaks the loop if the price is 0(Meaning it doesn't exist)
SaveBusiness(id);//Calls the SaveBusiness function.
}
forward SaveBusiness(id);
Don't add them wherever you find space in the editor but inside the appropriated callbacks.
Add the rest inside the correct callback, it should say where in the tutorial or I guess it's self-explanatory.