Loading objects from a file
#1

Can someone please try to explain to me how I can do this? and/or show me a little example?
Reply
#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
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)