25.07.2017, 18:02
I need to load object from .txt file but iam stuck at this Anyone can help me solve this?
my .txt file looks like this:
It is CreateObject properties.
And there is my broken non working noobie code
I was looking for solution about 2 hours but i still can't find how to do this right way ... Iam newbie "pawner".
my .txt file looks like this:
Код:
19850,1196.842651,-1322.121337,15.398437,0.000000,0.000000,90.000000 1985,1196.842651,-1322.121337,23.938106,0.000000,0.000000,90.000000 1986,1196.842651,-1322.121337,23.938106,0.000000,0.000000,90.000000 1989,1197.681152,-1319.800903,18.398441,0.000000,0.000000,90.000000
And there is my broken non working noobie code
Код:
forward LoadMap(inputtext[]); public LoadMap(inputtext[]) { new load[192], path[64]; format(load, sizeof(load), "%s\r\n",load); format(path, sizeof(path), "Objects/%s.txt", inputtext); new File:oFile; oFile = fopen(path, io_read); fread(oFile, load); new count; while (fread(oFile, load)) { CreateObject(load); count++; } fclose(oFile); return count; }