SA-MP Forums Archive
array sizes do not match, or destination array is too small - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: array sizes do not match, or destination array is too small (/showthread.php?tid=156477)



array sizes do not match, or destination array is too small - wofka13 - 22.06.2010

(Sry for bad English )
I have problem with compiling,
it is the error "array sizes Thurs comes not match, or destination array is too small"

Код:
public opfa(playerid)
{
  new bString[256];
 	if(OpenINI("Haus.cfg"))
 	{
 	  for(new i=0;i<MAX_HOUSES;i++)
 		{
			if(IsPlayerInRangeOfPoint(playerid,5.0,HausInfo[i][eX],HausInfo[i][eY],HausInfo[i][eZ]))
			{
		 		format(bString, 64, "Vergeben%d", i);
			  	HausInfo[i][Vergeben] = ReadIntKey(bString);
				if(HausInfo[i][Vergeben] == 1)
				{
    			format(bString, 64, "Preis%d", i);
				 	HausInfo[i][Preis] = ReadIntKey(bString);
				 	format(bString, 64, "Besitzer%s", i);
				  	HausInfo[i][Besitzer] = ReadStringKey(bString);
					format(bString,sizeof(bString),"~g~Haus Informationen~n~~w~\nMietkosten: %d ~y~\nBesitzer: %s ~b~",HausInfo[i][Preis],HausInfo[i][Besitzer]);
					GameTextForPlayer(playerid,bString,2500,3);
				}
  			else
				{
    			format(bString, 64, "Preis%d", i);
				 	HausInfo[i][Preis] = ReadIntKey(bString);
		 		 	format(bString,sizeof(bString),"~g~Haus Informationen~n~~w~\nHaus PreiЯ: %d ~y~\nBesitzer: Staat ~b~",HausInfo[i][Preis]);
					GameTextForPlayer(playerid,bString,2500,3);
  			}
			}
		}
		CloseINI();
	}
	return 1;
}
I've been trying new bString to 128 and 512 set but it does not works
Thx


Re: array sizes do not match, or destination array is too small - bigcomfycouch - 22.06.2010

try setting bstring to 64


Re: array sizes do not match, or destination array is too small - wofka13 - 22.06.2010

not working


Re: array sizes do not match, or destination array is too small - wofka13 - 23.06.2010

nothing ideas?


Re: array sizes do not match, or destination array is too small - Kar - 23.06.2010

Код:
public opfa(playerid)
{
  new bString[128];
 	if(OpenINI("Haus.cfg"))
 	{
 	  for(new i=0;i<MAX_HOUSES;i++)
 		{
			if(IsPlayerInRangeOfPoint(playerid,5.0,HausInfo[i][eX],HausInfo[i][eY],HausInfo[i][eZ]))
			{
		 		format(bString, 128, "Vergeben%d", i);
			  	HausInfo[i][Vergeben] = ReadIntKey(bString);
				if(HausInfo[i][Vergeben] == 1)
				{
    			format(bString, 128, "Preis%d", i);
				 	HausInfo[i][Preis] = ReadIntKey(bString);
				 	format(bString, 128, "Besitzer%s", i);
				  	HausInfo[i][Besitzer] = ReadStringKey(bString);
					format(bString,sizeof(bString),"~g~Haus Informationen~n~~w~\nMietkosten: %d ~y~\nBesitzer: %s ~b~",HausInfo[i][Preis],HausInfo[i][Besitzer]);
					GameTextForPlayer(playerid,bString,2500,3);
				}
  			else
				{
    			format(bString, 128, "Preis%d", i);
				 	HausInfo[i][Preis] = ReadIntKey(bString);
		 		 	format(bString,sizeof(bString),"~g~Haus Informationen~n~~w~\nHaus PreiЯ: %d ~y~\nBesitzer: Staat ~b~",HausInfo[i][Preis]);
					GameTextForPlayer(playerid,bString,2500,3);
  			}
			}
		}
		CloseINI();
	}
	return 1;
}
whats the point in bstring anyways just use string

did that work?


Re: array sizes do not match, or destination array is too small - Antonio [G-RP] - 23.06.2010

You have to use the same size sting in both places. Kar's might work.


Re: array sizes do not match, or destination array is too small - Kar - 23.06.2010

yes i changed all the 64's to 128

and btw dont use 256 and 512 are you crazy those will load up your gm and make it take longer to compile


Re: array sizes do not match, or destination array is too small - NiiRV4N4 - 23.06.2010

Quote:
Originally Posted by Kar
yes i changed all the 64's to 128

and btw dont use 256 and 512 are you crazy those will load up your gm and make it take longer to compile
Isn't 256 the max number of characters you can have?


Re: array sizes do not match, or destination array is too small - (SF)Noobanatior - 23.06.2010

i bet its in this function "ReadIntKey(bString);"
the arays in there will need to be changed too :P


Re: array sizes do not match, or destination array is too small - Kar - 23.06.2010

Quote:
Originally Posted by NiiRV4N4
Quote:
Originally Posted by Kar
yes i changed all the 64's to 128

and btw dont use 256 and 512 are you crazy those will load up your gm and make it take longer to compile
Isn't 256 the max number of characters you can have?
yes but 128 loads faster. 256 shoudl only be used for err.. i forgot it should be used for something.. i cant remember but just use 128 lol.;p