29.07.2009, 20:54
But I have:
It doesn't work, or I am doing something wrong? It prints right float value in here: "printf("rofl %f", value);", but returns to 1.000
pawn Код:
stock sGetFloat(filename[], string[])
{
new filestring[256];
new fromline[128][2];
new File:newfile;
new Float:value;
newfile = fopen(filename, io_read);
if(!newfile)
{
print("file not found");
return floatround(value);
}
while(fread(newfile, filestring))
{
if(!strcmp(string, filestring, true, strlen(string)) && (filestring[strlen(string)] == '='))
{
split(filestring, fromline, '=');
value = floatstr(fromline[1]);
printf("rofl %f", value);
return floatround(value);
}
}
fclose(newfile);
return floatround(value);
}