table overflow : "staging buffer"
#1

I made somting for the family vehicles
its was over 150 lines ithink
i got that error and then i looked up in ****** they told me to put like a breaker between each line so i put a " // brea "

But i still go the error
Here's the code


Код:
stock SaveFamilies()
{
	new idx = 1, File:file;
	new string[1300];
	while(idx < MAX_FAMILIES)
	{
	    format(string, sizeof(string), "%d|%s|%s|%d|%s|%d|%f|%f|%f|%d|%d|%d|%d|%s|%s|%s|%s|%s|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
		FamInfo[idx][fTaken],
		FamInfo[idx][fName],
		FamInfo[idx][fMOTD],
		FamInfo[idx][fColor],
		FamInfo[idx][fLeader],
		FamInfo[idx][fMembers],
		FamInfo[idx][fSafeX],
		FamInfo[idx][fSafeY],
		FamInfo[idx][fSafeZ],
		FamInfo[idx][fMoney],
		FamInfo[idx][fMats],
		FamInfo[idx][fWeed],
		FamInfo[idx][fcocaine],
		FamInfo[idx][fRank1],
		FamInfo[idx][fRank2],
		FamInfo[idx][fRank3],
		FamInfo[idx][fRank4],
		FamInfo[idx][fRank5],
		FamInfo[idx][fRank6],
		FamInfo[idx][fSkins][0],
		FamInfo[idx][fSkins][1],
		FamInfo[idx][fSkins][2],
		FamInfo[idx][fSkins][3],
		FamInfo[idx][fSkins][4],
		FamInfo[idx][fSkins][5],
		FamInfo[idx][fSkins][6],
		FamInfo[idx][fStrikes],
		FamInfo[idx][fVehType][0], // Veh 1
		// Bre
		FamInfo[idx][fVehType][1], // Veh 2
		// Bre
		FamInfo[idx][fVehType][2], // Veh 3
		// Bre
		FamInfo[idx][fVehType][3], // Veh 4
		// Bre
		FamInfo[idx][fVehType][4], // Veh 5
		// Bre
		FamInfo[idx][fVehType][5], // Veh 6
		// Bre
		FamInfo[idx][fVehType][6], // Veh 7
		// Bre
		FamInfo[idx][fVehType][7], // Veh 8
		// Bre
		FamInfo[idx][fVehType][8], // Veh 9
		// Bre
		FamInfo[idx][fVehType][9], // Veh 10
		// Bre
		FamInfo[idx][fVehType][10], // Veh 11
		// Bre
		FamInfo[idx][fVehType][11], // Veh 12
		// Bre
		FamInfo[idx][fVehType][12], // Veh 13
		// Bre
		FamInfo[idx][fVehType][13], // Veh 14
		// Bre
		FamInfo[idx][fVehType][14], // Veh 15
		// Bre
		FamInfo[idx][fVehCoX][0], // Veh 1 Coords
		// Bre
		FamInfo[idx][fVehCoY][0],
		// Bre
		FamInfo[idx][fVehCoZ][0],
		// Bre
		FamInfo[idx][fVehCoX][1], // Veh 2 Coords
		// Bre
		FamInfo[idx][fVehCoY][1],
		// Bre
		FamInfo[idx][fVehCoZ][1],
		// Bre
		FamInfo[idx][fVehCoX][2], // Veh 3 Coords
		// Bre
		FamInfo[idx][fVehCoY][2],
		// Bre
		FamInfo[idx][fVehCoZ][2],
		// Bre
		FamInfo[idx][fVehCoX][3], // Veh 4 Coords
		// Bre
		FamInfo[idx][fVehCoY][3],
		// Bre
		FamInfo[idx][fVehCoZ][3],
		// Breaker
		FamInfo[idx][fVehCoX][4], // Veh 5 Coords
		// Bre
		FamInfo[idx][fVehCoY][4],
		// Bre
		FamInfo[idx][fVehCoZ][4],
		// Breaker
		FamInfo[idx][fVehCoX][5], // Veh 6 Coords
		// Bre
		FamInfo[idx][fVehCoY][5],
		// Bre
		FamInfo[idx][fVehCoZ][5],
		// Bre
		FamInfo[idx][fVehCoX][6], // Veh 7
		// Bre
		FamInfo[idx][fVehCoY][6],
		// Bre
		FamInfo[idx][fVehCoZ][6],
		// Bre
		FamInfo[idx][fVehCoX][7], // Veh 8
		// Bre
		FamInfo[idx][fVehCoY][7],
		// Bre
		FamInfo[idx][fVehCoZ][7],
		// Bre
		FamInfo[idx][fVehCoX][8], // Veh 9
		// Bre
		FamInfo[idx][fVehCoY][8],
		// Bre
		FamInfo[idx][fVehCoZ][8],
		// Bre
		FamInfo[idx][fVehCoX][9], // Veh 10
		// Bre
		FamInfo[idx][fVehCoY][9],
		// Bre
		FamInfo[idx][fVehCoZ][9],
		// Bre
		FamInfo[idx][fVehCoX][10], // Veh 11
		// Bre
		FamInfo[idx][fVehCoY][10],
		// Bre
		FamInfo[idx][fVehCoZ][10],
		// Bre
		FamInfo[idx][fVehCoX][11], // Veh 12
		// Bre
		FamInfo[idx][fVehCoY][11],
		// Bre
		FamInfo[idx][fVehCoZ][11],
		// Bre
		FamInfo[idx][fVehCoX][12], // Veh 13
		// Bre
		FamInfo[idx][fVehCoY][12],
		// Bre
		FamInfo[idx][fVehCoZ][12],
		// Bre
		FamInfo[idx][fVehCoX][13], // Veh 14
		// Bre
		FamInfo[idx][fVehCoY][13],
		// Bre
		FamInfo[idx][fVehCoZ][13],
		// Bre
		FamInfo[idx][fVehCoX][14], // Veh 15
		// Bre
		FamInfo[idx][fVehCoY][14],
		// Bre
		FamInfo[idx][fVehCoZ][14],
		// Breaker
		FamInfo[idx][fVehRot][0],
		 //
		FamInfo[idx][fVehRot][1],
		// Bre
		FamInfo[idx][fVehRot][2],
		// Bre
		FamInfo[idx][fVehRot][3],
		// Bre
		FamInfo[idx][fVehRot][4],
		// Bre
		FamInfo[idx][fVehRot][5],
		// Bre
		FamInfo[idx][fVehRot][6],
		// Bre
		FamInfo[idx][fVehRot][7],
		// Bre
		FamInfo[idx][fVehRot][8],
		// Bre
		FamInfo[idx][fVehRot][9],
		// Bre
		FamInfo[idx][fVehRot][10],
		// Bre
		FamInfo[idx][fVehRot][11],
		// Bre
		FamInfo[idx][fVehRot][12],
		// Bre
		FamInfo[idx][fVehRot][13],
		// Bre
		FamInfo[idx][fVehRot][14],
		// Breaker
		FamInfo[idx][fVehCol1][0],
		 //// Bre
		FamInfo[idx][fVehCol1][1],
		// Bre
		FamInfo[idx][fVehCol1][2],
		// Bre
		FamInfo[idx][fVehCol1][3],
		// Bre
		FamInfo[idx][fVehCol1][4],
		// Bre
		FamInfo[idx][fVehCol1][5],
		// Bre
		FamInfo[idx][fVehCol1][6],
		// Bre
		FamInfo[idx][fVehCol1][7],
		// Bre
		FamInfo[idx][fVehCol1][8],
		// Bre
		FamInfo[idx][fVehCol1][9],
		// Bre
		FamInfo[idx][fVehCol1][10],
		// Bre
		FamInfo[idx][fVehCol1][11],
		// Bre
		FamInfo[idx][fVehCol1][12],
		// Bre
		FamInfo[idx][fVehCol1][13],
		// Bre
		FamInfo[idx][fVehCol1][14],
		// Breaker
		FamInfo[idx][fVehCol2][0],
		 //
		FamInfo[idx][fVehCol2][1],
		// Bre
		FamInfo[idx][fVehCol2][2],
		// Bre
		FamInfo[idx][fVehCol2][3],
		// Bre
		FamInfo[idx][fVehCol2][4],
		// Bre
		FamInfo[idx][fVehCol2][5],
		// Bre
		FamInfo[idx][fVehCol2][6],
		// Bre
		FamInfo[idx][fVehCol2][7],
		// Bre
		FamInfo[idx][fVehCol2][8],
		// Bre
		FamInfo[idx][fVehCol2][9],
		// Bre
		FamInfo[idx][fVehCol2][10],
		// Bre
		FamInfo[idx][fVehCol2][11],
		// Bre
		FamInfo[idx][fVehCol2][12],
		// Bre
		FamInfo[idx][fVehCol2][13],
		// Bre
		FamInfo[idx][fVehCol2][14]);
	    if(idx == 1)
	    {
	        file = fopen("families.cfg", io_write);
	    }
	    else
	    {
	    	file = fopen("families.cfg", io_append);
	    }
		fwrite(file, string);
		fclose(file);
		idx++;
	}
	print("Families saved successfully.");
}
Reply
#2

bump
please help
Reply
#3

instead of calling all these 1 by 1 do them in a loop and store them in 1 string.
You save lines & rows

example
pawn Код:
new TotalString[60],str[40];
for(new i=0; i < 14; i++)
    {
        format(str,sizeof str,"%d|",FamInfo[idx][fVehCol1][i]);
        strins(TotalString, str, sizeof TotalString);
    }
//"TotalString" Will Have all of them then just format them like this
format(string, sizeof(string), "%s",TotalString);
Also you have too much tabs on the variable!
Reply
#4

Can you show me a example of 2 lines to make them in 1 string please

my lines
Reply
#5

ok,
This one will store all 6 FamInfo[idx][fSkins] and all 14 FamInfo[idx][fVehType] into 2 strings
pawn Код:
new TotalString[60][2],str[40];//somewhere to store the FINAL '2' strings
for(new i=0; i < 6; i++)//see the "6" that's how many times this code will run through(loop)!
//the "0" means it will start the loop from "0"
    {
        format(str,sizeof str,"%d|",FamInfo[idx][fSkins][i]);
        strins(TotalString[0], str, sizeof TotalString);
    }

//now the second array
for(new i=0; i < 14; i++)//now is '14' because we need to loop it 14 times
//Again "0" which will start the loop from "0"
    {
        format(str,sizeof str,"%d|",FamInfo[idx][fVehType][i]);
        strins(TotalString[1], str, sizeof TotalString);
    }

//and to show them in a final string
new FinalString[120];
format(FinalString,sizeof FinalString,"%s,%s",TotalString[0],TotalString[1]);
//In your case your saving it so
fwrite(file, FinalString);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)