Error in business system.
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
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.

Also, it's not:
pawn Код:
new InsideBiz;[MAX_PLAYERS]
but:
pawn Код:
new InsideBiz[MAX_PLAYERS];
and not:
pawn Код:
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.
but:
pawn Код:
new BusinessInfo[200][bInfo];//We are creating a define to use for our Enum.
new BizID;// You'll also have to save this, and load this..I expect you know how to do this.
Add the rest inside the correct callback, it should say where in the tutorial or I guess it's self-explanatory.
Thanks, it's fixed the line 41-42 but now i have more errors .. : /imageshack/img819/929/izk6.png
You have skype or something you can help me with that?
Reply


Messages In This Thread
Error in business system. - by Dorlevi1506 - 13.11.2013, 15:18
Re: Error in business system. - by Avi Raj - 13.11.2013, 15:23
Re: Error in business system. - by Dorlevi1506 - 13.11.2013, 15:33
Re: Error in business system. - by Konstantinos - 13.11.2013, 16:36
Re: Error in business system. - by Dorlevi1506 - 13.11.2013, 17:06
Re: Error in business system. - by Konstantinos - 13.11.2013, 17:07
Re: Error in business system. - by Dorlevi1506 - 13.11.2013, 17:17
Re: Error in business system. - by Konstantinos - 13.11.2013, 17:22
Re: Error in business system. - by Dorlevi1506 - 13.11.2013, 17:27
Re: Error in business system. - by Konstantinos - 13.11.2013, 17:30

Forum Jump:


Users browsing this thread: 1 Guest(s)