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)
+--- Thread: error 047: array sizes do not match, or destination array is too small (/showthread.php?tid=521532)



error 047: array sizes do not match, or destination array is too small - KurtAngle - 23.06.2014

Код:
new File:f, templine[256], TBuilder[MAX_PLAYER_NAME], TempLapper[MAX_PLAYER_NAME], TempLap;
			idx=0;
			f = fopen(temprace, io_read);
			fread(f,templine,sizeof(templine));
			if(templine[0] == 'Y')
			{
				new fileversion;
			    strtok(templine,idx);
				fileversion = strval(strtok(templine,idx));
				if(fileversion > VERSION)
				{
				    format(stringagara,sizeof(stringagara),"Race \'%s\' is created with a newer version of YRACE, unable to load.",tmp);
				    SendClientMessage(playerid,RED,stringagara);
				    return 1;
				}
				TBuilder=strtok(templine,idx); <------ERROR LINE!!!!
I've tried to change templine[256] in templine[512] or templine[128], nothing change, same errors.
Thanks for the help!


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

Код:
new File:f, templine[256], TBuilder[MAX_PLAYER_NAME], TempLapper[MAX_PLAYER_NAME], TempLap;
			idx=0;
			f = fopen(temprace, io_read);
			fread(f,templine,sizeof(templine));
			if(templine[0] == 'Y')
			{
				new fileversion;
				fileversion = strval(strtok(templine,idx));
				if(fileversion > VERSION)
				{
				    format(stringagara,sizeof(stringagara),"Race \'%s\' is created with a newer version of YRACE, unable to load.",tmp);
				    SendClientMessage(playerid,RED,stringagara);
				    return 1;
				}
				TBuilder=strtok(templine,idx);



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

Nothing change! Same error! In the same line!
Код:
TBuilder=strtok(templine,idx);



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

Nobody knows how to solve?


Re: error 047: array sizes do not match, or destination array is too small - [WSF]ThA_Devil - 23.06.2014

Код:
format(Tbuilder,sizeof(Tbuilder),"%s",strtok(templine,idx));



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

Finally! It works! Thanks thanks!!!