Help with family bank.
#1

I get loads of errors :

Код:
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(3054) : error 021: symbol already defined: "sscanf"
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(12712) : error 021: symbol already defined: "strtok"
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(12727) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14320) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14528) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14808) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14829) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14853) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14861) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14886) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14894) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14922) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(14960) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15010) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15018) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15189) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15192) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15228) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15270) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15436) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15470) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15508) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15544) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15754) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(15877) : error 047: array sizes do not match, or destination array is too small
C:\Users\Zak\Desktop\samp03asvr_R3_win32\gamemodes\nyrp.pwn(16012) : error 047: array sizes do not match, or destination array is too small

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


26 Errors.
I added the below:, can you tell me which one is giving the problem and why?

Код:
enum BInfo
{
	CashStored,
	MatsStored,
	DrugsStored,
	Owner,
};
new BankInfo[25][BInfo];
Код:
public LoadBank()
{
	new arrCoords[16][64];
	new strFromFile2[256];
	new File: file = fopen("facbanks.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(BankInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, '|');
  			BankInfo[idx][Owner] = strval(arrCoords[0]);
			BankInfo[idx][CashStored] = strval(arrCoords[1]);
			BankInfo[idx][MatsStored] = strval(arrCoords[2]);
			BankInfo[idx][DrugsStored] = strval(arrCoords[3]);
			printf("Faction:%d Cash In Bank:%d Materials In Bank: %d Drugs In Bank: %d",
			idx,BankInfo[idx][CashStored],BankInfo[idx][MatsStored],BankInfo[idx][DrugsStored]);
			idx++;
		}
		fclose(file);
	}
	return 1;
}

public SaveBank()
{
	new idx;
	new File: file2;
	while (idx < sizeof(BankInfo))
	{
		new coordsstring[256];
		format(coordsstring, sizeof(coordsstring), "%d|%d|%d|%d\n",
		BankInfo[idx][Owner],
		BankInfo[idx][CashStored],
		BankInfo[idx][MatsStored],
		BankInfo[idx][DrugsStored]);
		if(idx == 0)
		{
			file2 = fopen("facbanks.cfg", io_write);
		}
		else
		{
			file2 = fopen("facbanks.cfg", io_append);
		}
		fwrite(file2, coordsstring);
		idx++;
		fclose(file2);
	}
	return 1;
}
Thats all the code

YES, i have LoadBank at startup..

i just get errors, i'm not sure why.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)