Business
#1

Wanted to know if here somewhere is mistake?

Код:
LoadBusinesses() {

	if(!fexist("businesses.cfg")) return 1;

	new
		szFileStr[1024],
		File: iFileHandle = fopen("businesses.cfg", io_read),
		iIndex;

	while(iIndex < sizeof(BizInfo) && fread(iFileHandle, szFileStr)) {
		sscanf(szFileStr, "p<|>ffffffffiis[24]iiiiiis[128]iiiiiii",			
			BizInfo[iIndex][bLocation_x],
            BizInfo[iIndex][bLocation_y],
            BizInfo[iIndex][bLocation_z],
            BizInfo[iIndex][bExitAngle],
            BizInfo[iIndex][bIntLocationx],
            BizInfo[iIndex][bIntLocationy],
            BizInfo[iIndex][bIntLocationz],
            BizInfo[iIndex][bEnterAngle],
            BizInfo[iIndex][bVirtualWorld],
            BizInfo[iIndex][bInterior],
            BizInfo[iIndex][bOwner],
            BizInfo[iIndex][bOwned],
            BizInfo[iIndex][bLocked],
            BizInfo[iIndex][bPrice],
            BizInfo[iIndex][bType],
            BizInfo[iIndex][bCameras],
            BizInfo[iIndex][bTill],
            BizInfo[iIndex][bName],
            BizInfo[iIndex][bFee],
            BizInfo[iIndex][bPInt],
            BizInfo[iIndex][bPVW],
            BizInfo[iIndex][bProducts],
            BizInfo[iIndex][bLottoTime],
            BizInfo[iIndex][bLottoJackpot],
            BizInfo[iIndex][bNewLottoJackpot]
		);

		if(BizInfo[iIndex][bOwned]) {
			format(szFileStr, sizeof(szFileStr), "This business is owned by\n%s\nDescription: %s\nLevel: %d\nType: %d\nID: %d",BizInfo[iIndex][bOwner],BizInfo[iIndex][bDescription],BizInfo[iIndex][bLevel],BizInfo[iIndex][bType],iIndex);

			DestroyDynamicPickup(BizInfo[iIndex][bPickupID]);
			BizInfo[iIndex][bPickupID] = CreateDynamicPickup(19132, 23, BizInfo[iIndex][bExteriorX], BizInfo[iIndex][bExteriorY], BizInfo[iIndex][bExteriorZ]);
		}
		else format(szFileStr, sizeof(szFileStr), "This business is\n for sale!\n Description: %s\nCost: $%d\n Level: %d\nType: %d\nID: %d\nTo buy this business type /buybusiness",BizInfo[iIndex][bDescription],BizInfo[iIndex][bValue],BizInfo[iIndex][bLevel],BizInfo[iIndex][bType],iIndex);

		DestroyDynamicPickup(BizInfo[iIndex][bPickupID]);
		BizInfo[iIndex][bPickupID] = CreateDynamicPickup(19132, 23, BizInfo[iIndex][bExteriorX], BizInfo[iIndex][bExteriorY], BizInfo[iIndex][bExteriorZ]);
		BizInfo[iIndex][bTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_LIGHTBLUE, BizInfo[iIndex][bExteriorX], BizInfo[iIndex][bExteriorY], BizInfo[iIndex][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
		
		
		if(BizInfo[h][bOwned] == 0 && BizInfo[h][bType] != 0)
			{
	  			new VString[255];
			    new price = BizInfo[h][bPrice];
		        format(VString,sizeof(VString),"{33AA33}Business for sale!{F0CC00}\nPrice: $%d \nType /buybiz to purchase it", price);
		        BizLabel[h] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_DCHAT, BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[h][bPVW], BizInfo[h][bPInt], -1, 100.0);
		        BizPickup[h] = CreateDynamicPickup(1272, 1, BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], BizInfo[h][bPVW], BizInfo[h][bPInt], -1, 100.0);
			        if(BizInfo[h][bType] == 1)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 17, 0);
					else if(BizInfo[h][bType] == 2)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 49, 0);
		            else if(BizInfo[h][bType] == 3)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 18, 0);
		            else if(BizInfo[h][bType] == 4)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 50, 0);
		            else if(BizInfo[h][bType] == 5)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 45, 0);
		            else if(BizInfo[h][bType] == 6)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 40, 0);
		            else if(BizInfo[h][bType] == 7)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 25, 0);
			        else if(BizInfo[h][bType] == 8)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 36, 0);
					else if(BizInfo[h][bType] == 9)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 10, 0);
					else if(BizInfo[h][bType] == 10)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 14, 0);
					else if(BizInfo[h][bType] == 11)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 29, 0);
					else if(BizInfo[h][bType] == 12)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 48, 0);
					else if(BizInfo[h][bType] == 13)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 23, 0);
					else if(BizInfo[h][bType] == 14)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 21, 0);
			}
			if(BizInfo[h][bOwned] == 1 && BizInfo[h][bType] != 0)
			{
		 		new VString[255];
			    new name[25], owner[MAX_PLAYER_NAME];
	   			strmid(owner, BizInfo[h][bOwner], 0, strlen(BizInfo[h][bOwner]), 255);
				strmid(name, BizInfo[h][bName], 0, strlen(BizInfo[h][bName]), 255);
		        format(VString,sizeof(VString),"{33AA33}[Business]{FFFFFF}\n%s{F0CC00}\nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[h][bFee]);
		        BizLabel[h] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_DCHAT, BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[h][bPVW], BizInfo[h][bPInt], -1, 100.0);
		        BizPickup[h] = CreateDynamicPickup(1272, 1, BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], BizInfo[h][bPVW], BizInfo[h][bPInt], -1, 100.0);
			        if(BizInfo[h][bType] == 1)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 17, 0);
					else if(BizInfo[h][bType] == 2)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 49, 0);
		            else if(BizInfo[h][bType] == 3)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 18, 0);
		            else if(BizInfo[h][bType] == 4)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 50, 0);
		            else if(BizInfo[h][bType] == 5)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 45, 0);
		            else if(BizInfo[h][bType] == 6)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 40, 0);
		            else if(BizInfo[h][bType] == 7)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 25, 0);
			        else if(BizInfo[h][bType] == 8)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 36, 0);
					else if(BizInfo[h][bType] == 9)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 10, 0);
					else if(BizInfo[h][bType] == 10)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 14, 0);
					else if(BizInfo[h][bType] == 11)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 29, 0);
					else if(BizInfo[h][bType] == 12)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 48, 0);
					else if(BizInfo[h][bType] == 13)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 23, 0);
					else if(BizInfo[h][bType] == 14)
			            BizIcon[h] = CreateDynamicMapIcon(BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], 21, 0);
			}
			if(BizInfo[h][bOwned] == 0 && BizInfo[h][bType] == 0)
			{
	  			new VString[255];
			    new name[25];
				strmid(name, BizInfo[h][bName], 0, strlen(BizInfo[h][bName]), 255);
		        format(VString,sizeof(VString),"{33AA33}[Business]{FFFFFF}\n%s", name);
		        BizLabel[h] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_DCHAT, BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[h][bPVW], BizInfo[h][bPInt], -1, 100.0);
		        BizPickup[h] = CreateDynamicPickup(1239, 1, BizInfo[h][bLocation_x], BizInfo[h][bLocation_y], BizInfo[h][bLocation_z], BizInfo[h][bPVW], BizInfo[h][bPInt], -1, 100.0);
			}
	}
	return fclose(iFileHandle);
}
Reply


Messages In This Thread
Business - by FaZeRs - 01.07.2014, 15:25

Forum Jump:


Users browsing this thread: 1 Guest(s)