SA-MP Forums Archive
error 047: 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: error 047: array sizes do not match, or destination array is too small (/showthread.php?tid=211070)



error 047: array sizes do not match, or destination array is too small - sekol - 14.01.2011

I'm working on Dynamic Factions script and i get this error
Код:
error 047: array sizes do not match, or destination array is too small
On this line
Код:
public LoadFactions()
{
    new string[128], otherstring[128];
    for(new i = 0; i < MAX_GROUPS; i++)
    {
    	format(string, sizeof(string),"Faction_%d",i);
		if(djIsSet(FACTIONS_FILE, string))
		{
			*/-*format(otherstring, sizeof(otherstring),"Faction_%d/FactionName",i); FactionInfo[i][fName] = dj(FACTIONS_FILE, otherstring);*-\*
Marked with */-* and *-\*
Help!


Re: error 047: array sizes do not match, or destination array is too small - Rizard - 14.01.2011

I think making them 255 is a solution but it's not a good one!

... someone should post a better one ...


Re: error 047: array sizes do not match, or destination array is too small - sekol - 14.01.2011

THEM? You mean "string" and "otherstring" ?


Re: error 047: array sizes do not match, or destination array is too small - Jochemd - 14.01.2011

pawn Код:
FactionInfo[i][fName] = dj(FACTIONS_FILE, otherstring);
to
pawn Код:
format(FactionInfo[i][fName],sizeof(FactionInfo[i][fName]),"%s",dj(FACTIONS_FILE, otherstring));
Otherwise, they need to match PERFECT and that is not a good idea in this case with different owners.


Re: error 047: array sizes do not match, or destination array is too small - sekol - 14.01.2011

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Otherwise, they need to match PERFECT and that is not a good idea in this case with different owners.
What you mean by that? Should i do same on the rest of my script?

EDIT@@
it causes only 4 more errors
Код:
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(689) : error 001: expected token: "]", but found "-identifier-"
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(689) : warning 215: expression has no effect
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(689) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(689) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(689) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: error 047: array sizes do not match, or destination array is too small - sekol - 17.01.2011

BUMP!!