29.08.2010, 00:51
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!!
Obs.: The file and directory exists.
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;
}

