15.11.2014, 17:00
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:
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.
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; }
- 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.