Business system help
#1

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.
Reply


Messages In This Thread
Business system help - by jackx3rx - 15.11.2014, 17:00
Re: Business system help - by jackx3rx - 15.11.2014, 20:10
Re: Business system help - by jackx3rx - 16.11.2014, 09:55
Re: Business system help - by jackx3rx - 17.11.2014, 06:41
Re: Business system help - by jackx3rx - 17.11.2014, 17:18
Re: Business system help - by jackx3rx - 17.11.2014, 21:30
Re: Business system help - by Kyance - 18.11.2014, 06:22
Re: Business system help - by jackx3rx - 18.11.2014, 15:52
Re: Business system help - by jackx3rx - 21.11.2014, 06:49
Re: Business system help - by CoaPsyFactor - 21.11.2014, 09:47

Forum Jump:


Users browsing this thread: 2 Guest(s)