SA-MP Forums Archive
OMG! HELP! SIMPLE ERROR! - 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: OMG! HELP! SIMPLE ERROR! (/showthread.php?tid=525472)



OMG! HELP! SIMPLE ERROR! - LarryTiger - 12.07.2014

Код:
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1040 -- 1041) : error 001: expected token: ",", but found "["
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1041) : warning 217: loose indentation
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1041) : error 029: invalid expression, assumed zero
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1041) : error 017: undefined symbol "twName"
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1041) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
stock SaveTurfWars() {
	print("Saving Turfs.");
	if(!fexist("turfwars.cfg"))
		return 1;

	new
		szFileStr[1024],
		File: fHandle = fopen("turfwars.cfg", io_write);

	for(new iIndex; iIndex < MAX_TURFS; ++iIndex) {
1040		format(szFileStr, sizeof(szFileStr), "%s|%d|%d|%d|%d|%f|%f|%f|%f\r\n",
1041			TurfWars[iIndex][twName],
			TurfWars[iIndex][twOwnerId],
			TurfWars[iIndex][twLocked],
			TurfWars[iIndex][twSpecial],
			TurfWars[iIndex][twVulnerable],
			TurfWars[iIndex][twMinX],
			TurfWars[iIndex][twMinY],
			TurfWars[iIndex][twMaxX],
			TurfWars[iIndex][twMaxY]
		);
		fwrite(fHandle, szFileStr);
	}
	return fclose(fHandle);
}



Re: OMG! HELP! SIMPLE ERROR! - Brentbad04 - 12.07.2014

Try this
Код:
stock SaveTurfWars() 
{
	print("Saving Turfs.");
	if(!fexist("turfwars.cfg"))
	return 1;

	new
		szFileStr[1024],
		File: fHandle = fopen("turfwars.cfg", io_write);

	for(new iIndex; iIndex < MAX_TURFS; ++iIndex) 
	{
		1040	format(szFileStr, sizeof(szFileStr), "%s|%d|%d|%d|%d|%f|%f|%f|%f\r\n",
		1041	TurfWars[iIndex][twName],
			TurfWars[iIndex][twOwnerId],
			TurfWars[iIndex][twLocked],
			TurfWars[iIndex][twSpecial],
			TurfWars[iIndex][twVulnerable],
			TurfWars[iIndex][twMinX],
			TurfWars[iIndex][twMinY],
			TurfWars[iIndex][twMaxX],
			TurfWars[iIndex][twMaxY]
		);
		fwrite(fHandle, szFileStr);
	}
	return fclose(fHandle);
}



Re: OMG! HELP! SIMPLE ERROR! - LarryTiger - 12.07.2014

Quote:
Originally Posted by Brentbad04
Посмотреть сообщение
Try this
Код:
stock SaveTurfWars() 
{
	print("Saving Turfs.");
	if(!fexist("turfwars.cfg"))
	return 1;

	new
		szFileStr[1024],
		File: fHandle = fopen("turfwars.cfg", io_write);

	for(new iIndex; iIndex < MAX_TURFS; ++iIndex) 
	{
		1040	format(szFileStr, sizeof(szFileStr), "%s|%d|%d|%d|%d|%f|%f|%f|%f\r\n",
		1041	TurfWars[iIndex][twName],
			TurfWars[iIndex][twOwnerId],
			TurfWars[iIndex][twLocked],
			TurfWars[iIndex][twSpecial],
			TurfWars[iIndex][twVulnerable],
			TurfWars[iIndex][twMinX],
			TurfWars[iIndex][twMinY],
			TurfWars[iIndex][twMaxX],
			TurfWars[iIndex][twMaxY]
		);
		fwrite(fHandle, szFileStr);
	}
	return fclose(fHandle);
}
Код:
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1042 -- 1043) : error 001: expected token: ",", but found "["
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1043) : error 029: invalid expression, assumed zero
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1043) : error 017: undefined symbol "twName"
C:\DOCUME~1\user\Desktop\MARXRE~1\GAMEMO~1\PRRP.pwn(1043) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
stock SaveTurfWars()
{
	print("Saving Turfs.");
	if(!fexist("turfwars.cfg"))
	return 1;

	new
		szFileStr[1024],
		File: fHandle = fopen("turfwars.cfg", io_write);

	for(new iIndex; iIndex < MAX_TURFS; ++iIndex)
	{
1042			format(szFileStr, sizeof(szFileStr), "%s|%d|%d|%d|%d|%f|%f|%f|%f\r\n",
1043			TurfWars[iIndex][twName],
			TurfWars[iIndex][twOwnerId],
			TurfWars[iIndex][twLocked],
			TurfWars[iIndex][twSpecial],
			TurfWars[iIndex][twVulnerable],
			TurfWars[iIndex][twMinX],
			TurfWars[iIndex][twMinY],
			TurfWars[iIndex][twMaxX],
			TurfWars[iIndex][twMaxY]
		);
		fwrite(fHandle, szFileStr);
	}
	return fclose(fHandle);
}



Re: OMG! HELP! SIMPLE ERROR! - Ihateyou - 12.07.2014

show TurfWars array