[HELP] Load object from .txt
#1

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:
Код:
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
It is CreateObject properties.

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;
	
}
I was looking for solution about 2 hours but i still can't find how to do this right way ... Iam newbie "pawner".
Reply


Messages In This Thread
[HELP] Load object from .txt - by ThomasEvil - 25.07.2017, 18:02
Re: [HELP] Load object from .txt - by Kane - 25.07.2017, 22:11
Re: [HELP] Load object from .txt - by ThomasEvil - 26.07.2017, 23:30
Re: [HELP] Load object from .txt - by ThomasEvil - 27.07.2017, 19:48
Re: [HELP] Load object from .txt - by HoussamMaroc - 28.07.2017, 10:17
Re: [HELP] Load object from .txt - by Xeon™ - 28.07.2017, 11:31
Re: [HELP] Load object from .txt - by HoussamMaroc - 28.07.2017, 12:01
Re: [HELP] Load object from .txt - by Xeon™ - 28.07.2017, 12:04
Re: [HELP] Load object from .txt - by HoussamMaroc - 28.07.2017, 12:09
Re: [HELP] Load object from .txt - by HoussamMaroc - 28.07.2017, 12:11

Forum Jump:


Users browsing this thread: 1 Guest(s)