Business system help -
jackx3rx - 15.11.2014
I'm currently working on my business system, already set up the saving system (enum) and commands such as /createbusiness, /deletebusiness, /buybusiness. I'm now making a stock to load the houses when the server starts up, which I'd say half-works.
When I start up the server it only loads the pickup, not the text above it. Here is the code:
Код:
stock LoadBusinesses()
{
for(new i = 0; i < MAX_BUSINESSES;i++)
{
new filestring[60];
format(filestring,sizeof(filestring),BPATH,i);
INI_ParseFile(filestring,"LoadBusiness_%s", .bExtra = true, .extra = i);
{
new string[128];
if(BusinessInfo[i][bOwned] == true)
{
if(BusinessInfo[i][bType] == 1) // 24/7
{
format(string,sizeof(string),"%s 24/7 is currently owned by %s\nType /enter to go inside.",BusinessInfo[i][bLocation],BusinessInfo[i][bOwner]);
}
else if(BusinessInfo[i][bType] == 2) // Ammunation
{
format(string,sizeof(string),"%s Ammunation is currently owned by %s\nType /enter to go inside.",BusinessInfo[i][bLocation],BusinessInfo[i][bOwner]);
}
else if(BusinessInfo[i][bType] == 3) // Clothes store
{
format(string,sizeof(string),"%s Clothes Store is currently owned by %s\nType /enter to go inside.",BusinessInfo[i][bLocation],BusinessInfo[i][bOwner]);
}
BusinessPickup[i] = CreatePickup(1272,1,BusinessInfo[i][bOutsideX],BusinessInfo[i][bOutsideY],BusinessInfo[i][bOutsideZ],0);
BusinessLabel[i] = Create3DTextLabel(string,0x76C5EEFF,BusinessInfo[i][bOutsideX],BusinessInfo[i][bOutsideY],BusinessInfo[i][bOutsideZ] + 0.7,10,0,0);
}
else if(BusinessInfo[i][bOwned] == false)
{
if(BusinessInfo[i][bType] == 1) // 24/7
{
format(string,sizeof(string),"%s 24/7 is currently for sale! \nPurchase it for $%i",BusinessInfo[i][bLocation],BusinessInfo[i][bPrice]);
}
else if(BusinessInfo[i][bType] == 2) // Ammunation
{
format(string,sizeof(string),"%s Ammunation is currently for sale! \nPurchase it for $%i",BusinessInfo[i][bLocation],BusinessInfo[i][bPrice]);
}
else if(BusinessInfo[i][bType] == 3) // Clothes Store
{
format(string,sizeof(string),"%s Clothing Store (%i) is currently for sale! \nPurchase it for $%i",BusinessInfo[i][bLocation],BusinessInfo[i][bPrice]);
}
BusinessPickup[i] = CreatePickup(1273,1,BusinessInfo[i][bOutsideX],BusinessInfo[i][bOutsideY],BusinessInfo[i][bOutsideZ],0);
BusinessLabel[i] = Create3DTextLabel(string,0x32CD32FF,BusinessInfo[i][bOutsideX],BusinessInfo[i][bOutsideY],BusinessInfo[i][bOutsideZ] + 0.7,10,0,0);
}
}
}
return 1;
}
It basically asks if the business is owned, if it is then asks what type is the business (1-3), if the business is a 24/7 then it formats the 3D text label. Or if the business is an ammunation then it formats it differently etc. There is 6 different ways it can format:
- Business is owned, is 24/7
- Business is owned, is ammunation
- Business is owned, is clothes store
- Business is for sale, is 24/7
- Business is for sale, is ammunation
- Business is for sale, is clothes store
So yeah, any help is appreciated. It only loads the pickup icon atm, not the text floating above it.
Re: Business system help -
jackx3rx - 15.11.2014
I changed the text on the create3dtextlabel to test, it worked ig so the problem must be formatting it?
Please help, thanks
Re: Business system help -
jackx3rx - 16.11.2014
bump, im still stuck on this
Re: Business system help -
jackx3rx - 17.11.2014
help please
Re: Business system help -
jackx3rx - 17.11.2014
? help me please
Re: Business system help -
jackx3rx - 17.11.2014
Oh please? There must be somebody who can help me.
Re: Business system help -
Kyance - 18.11.2014
Go to the "blueberry" farm(x:0 y:0 z: 5) and see if the text is there.
( Just guessing, I remember I've had this kind of a problem ).
Re: Business system help -
jackx3rx - 18.11.2014
Yes! The text is at blueberry farm, coords 0 0 0 but how do I fix?
Re: Business system help -
jackx3rx - 21.11.2014
bump
Re: Business system help -
CoaPsyFactor - 21.11.2014
how do you load business info?
how do you store outsideX, outsideY and outsideZ coordinates?