02.09.2013, 03:57
Hi, I've just found that function but it's not working.
Can someone fix it?
For example I do:
It doesn't work. Can someone help me? I really need that function.
Can someone fix it?
PHP код:
stock INI_Get(filename[], key[])
{
new File:F,string[128];
new sname[24],sval[24];
F = fopen(filename,io_read);
if(!F) return sname;
while(fread(F,string))
{
sscanf(string,"p<=>s[24]s[24]",sname,sval);
if(!strcmp(sname,key))
{
sval[strlen(sval)-2] = 0;
fclose(F);
return sval;
}
}
fclose(F);
sname[0] = '\0';
return sname;
}
PHP код:
stock INI_GetValue(filename[], key[])
{
return strval(INI_Get(filename, key));
}
PHP код:
if(fexist("text.txt"))
{
printf("%d", INI_GetValue("text.txt", "Skills"));
}
else
{
print("File does not exist");
}