SA-MP Forums Archive
Help to load files with: fopen - 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: Help to load files with: fopen (/showthread.php?tid=172111)



Help to load files with: fopen - MasterKy - 29.08.2010

Hello!
I'm trying to make a script to load a file but not working. In other GM the same script works normally, but in my not.
I gave called all # includes, did the "OnGameModeInit ()" call the script: LoadAdmin(), but when I enter the server, the variables not assigned values.
Thanks for all help!!

Код:
public LoadAdmin()
{
	new arrCoords[3][64];
	new strFromFile2[256];
	new File: file = fopen("Arquivos/admins.cfg", io_read);
	if (file)
	{
	    new idx;
	    while(idx < sizeof(AdminInfo))
		{
		    fread(file, strFromFile2);
		    split(strFromFile2, arrCoords, ',');
		    AdminInfo[idx][AdminVaga] = strval(arrCoords[0]);
		    strmid(AdminInfo[idx][AdminNick], arrCoords[1], 0, strlen(arrCoords[1]), 255);
		    AdminInfo[idx][AdminLV] = strval(arrCoords[2]);
			AdminInfo[idx][aID] = idx;
			idx++;
		}
	}
	fclose(file);
	return 1;
}
Obs.: The file and directory exists.


Re: Help to load files with: fopen - MasterKy - 29.08.2010

anyone?!!


Re: Help to load files with: fopen - MasterKy - 29.08.2010

Hii =D plz help =s