Help to load files with: fopen
#1

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.
Reply
#2

anyone?!!
Reply
#3

Hii =D plz help =s
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)