05.10.2009, 04:15
This is what I use to load my objects from files
The only problem being if there is more than 6 decimal places it returns the float as 0.000000
Is there anyway I can fix this without having to go through every object and deleting some decimals?
pawn Код:
forward LoadObjects();
public LoadObjects()
{
new File:file, str[128];
format(str, sizeof str, "CoDS/Maps/%s/Map.ini", MapName);
file = fopen(str, io_read);
if (!file) return 0;
new
line[128],
count,
modelid,
Float:X, Float:Y, Float:Z,
Float:rX, Float:rY, Float:rZ;
while (fread(file, line))
{
if (!sscanf(line, "iffffff", modelid, X, Y, Z, rX, rY, rZ))
{
CreateObject(modelid, X, Y, Z, rX, rY, rZ);
count++;
}
}
fclose(file);
return count;
}
Is there anyway I can fix this without having to go through every object and deleting some decimals?