SA-MP Forums Archive
Dini - 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: Dini (/showthread.php?tid=550611)



Dini - jackx3rx - 13.12.2014

Hi, I'm trying to read a dini file but it gives off the error:

error 006: must be assigned to an array


Код:
public CheckAdminLevel(playerid)
{
	new filestring[60];
        format(filestring,sizeof(filestring),"%s.ini",playerid);
	if(fexist(filestring))
	{
		adminlevel[playerid] = dini_Get(filestring,"AdminLevel"); // << This line has the error.
	}
	return adminlevel[playerid];
}



Re: Dini - Schneider - 14.12.2014

I assume the adminlevel is stored as an integer (number) instead of a string, so you should use dini_Int, not dini_Get