18.09.2010, 12:45
Hey i am trying to make something that loads objects from file but for some reason it is not working here is the coding
i saved 1 object in file in correct format and it will not load why
Quote:
public LoadObjects() { new arrCoords[5][64]; new strFromFile2[256]; new File: file = fopen("LARP/object.txt", io_read); if (file) { new idx = 10; while (idx < sizeof(Object1)) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); Object1[idx][oid] = strval(arrCoords[0]); Object1[idx][obx] = strval(arrCoords[1]); Object1[idx][oby] = strval(arrCoords[2]); Object1[idx][obz] = strval(arrCoords[3]); Object1[idx][orx] = strval(arrCoords[4]); CreateDynamicObject(Object1[idx][oid],Object1[idx][obx],Object1[idx][oby],Object1[idx][obz],Object1[idx][orx],0,0); idx++; } printf("[SCRIPT]: Loaded %d Objects", idx); fclose(file); } return 1; } |