Error in business system. -
Dorlevi1506 - 13.11.2013
Hello guys.
I tried to make Business system with this tutorial:
https://sampforum.blast.hk/showthread.php?tid=349466
And it doesn't working.. the code i make is here :
http://pastebin.com/uS59Jtsw
Picture of the error:
/imageshack/img541/9347/0cvk.png
Someone can try help me fix it? its say the error in line 40-72.
Please help me..
Re: Error in business system. -
Avi Raj - 13.11.2013
Without seeing error, we can't Help you.
Show us what error are you getting.
Re: Error in business system. -
Dorlevi1506 - 13.11.2013
Quote:
Originally Posted by Avi Raj
Without seeing error, we can't Help you.
Show us what error are you getting.
|
I upload the error :
/imageshack/img541/9347/0cvk.png
Can you help me to fix it? its in line 40 - 43
Re: Error in business system. -
Konstantinos - 13.11.2013
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.
Re: Error in business system. -
Dorlevi1506 - 13.11.2013
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?
Re: Error in business system. -
Konstantinos - 13.11.2013
Replace:
to:
and replace str to szStr to the rest of the code (if it was used anywhere) as well.
Re: Error in business system. -
Dorlevi1506 - 13.11.2013
Quote:
Originally Posted by Konstantinos
Replace:
to:
and replace str to szStr to the rest of the code (if it was used anywhere) as well.
|
Wow really thanks bro but now i got more 5 errors..
/imageshack/img826/3646/z65s.png
Re: Error in business system. -
Konstantinos - 13.11.2013
Quote:
Originally Posted by Dorlevi1506
|
Quote:
Originally Posted by Konstantinos
[..]
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.
|
Using them outside of any callback will result in those errors.
Re: Error in business system. -
Dorlevi1506 - 13.11.2013
Quote:
Originally Posted by Konstantinos
Using them outside of any callback will result in those errors.
|
So i cant fix it?
Re: Error in business system. -
Konstantinos - 13.11.2013
Quote:
Originally Posted by Dorlevi1506
So i cant fix it?
|
Read the tutorial again, buddy. It says where you should add the code:
Quote:
Originally Posted by JhnzRep
You will need this under public OnGameModeInit():
pawn Код:
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) }
You will need this under public OnGameModeExit():
pawn Код:
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. }
|