Loading objects from a file
#2

pawn Код:
LoadObjectsFromFile(const filename[])
{
    new
      File:file = fopen(filename, 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;
}
Reply


Messages In This Thread
Loading objects from a file - by Gappy - 28.08.2009, 10:30
Re: Loading objects from a file - by Zeex - 28.08.2009, 11:09
Re: Loading objects from a file - by Gappy - 28.08.2009, 11:18

Forum Jump:


Users browsing this thread: 1 Guest(s)