28.11.2010, 16:49
Код:
stock InitBusinesses() { new FileName[128]; for(new i = 0; i < MAX_BUSINESSES; i++) { format(FileName, sizeof(FileName), "Businesses/Business_%d.ini", i); if(fexist(FileName)) { BizzInfo[i][bEntranceX] = dini_Float(FileName, "EntranceX"); BizzInfo[i][bEntranceY] = dini_Float(FileName, "EntranceY"); BizzInfo[i][bEntranceZ] = dini_Float(FileName, "EntranceZ"); BizzInfo[i][bExitX] = dini_Float(FileName, "ExitX"); BizzInfo[i][bExitY] = dini_Float(FileName, "ExitY"); BizzInfo[i][bExitZ] = dini_Float(FileName, "ExitZ"); BizzInfo[i][bInterior] = dini_Int(FileName, "Interior"); BizzInfo[i][bOwner] = dini_Get(FileName, "Owner"); //ERROR. BizzInfo[i][bLocked] = dini_Int(FileName, "Locked"); BizzInfo[i][bBuyPrice] = dini_Int(FileName, "BuyPrice"); BizzInfo[i][bTill] = dini_Int(FileName, "Till"); BizzInfo[i][bProducts] = dini_Int(FileName, "Products"); BizzInfo[i][bEntranceCost] = dini_Int(FileName, "EntranceCost"); BizzInfo[i][bOwned] = dini_Int(FileName, "Owned"); BizzInfo[i][bMessage] = dini_Get(FileName, "Message"); //ERROR. BizzInfo[i][bTagLabel] = dini_Int(FileName, "TagLabel"); BizzInfo[i][bTextLabelOwner] = dini_Int(FileName, "TextLabelOwner"); BizzInfo[i][bPickupID] = CreatePickup(1272, 23, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]); new string[255]; printf("[system] Business %d spawned.", i); format(string, sizeof(string),"%s", BizzInfo[i][bTagLabel]); Create3DTextLabel(string,COLOR_WHITE,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]+0.88,20.0,0,1); strmid(BizzInfo[i][bTagLabel], string, 0, strlen(string), 255); //owner format(string, sizeof(string),"Owner: %s", BizzInfo[i][bOwner]); Create3DTextLabel(string,COLOR_WHITE,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]+0.74,20.0,0,1); strmid(BizzInfo[i][bTextLabelOwner], string, 0, strlen(string), 255); format(string, sizeof(string),"Business ID: %d", i); Create3DTextLabel(string,COLOR_YELLOW,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]+0.60,20.0,0,1); format(string, sizeof(string),"Entrance Fee: $%s", BizzInfo[i][bEntranceCost]); Create3DTextLabel(string,COLOR_WHITE,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]+0.50,20.0,0,1); SpawnedBusinesses++; } } return 1; }
Код:
error 047: array sizes do not match, or destination array is too small
The error lines:
Код:
BizzInfo[i][bMessage] = dini_Get(FileName, "Message");
Код:
BizzInfo[i][bOwner] = dini_Get(FileName, "Owner");