Save Problem +REP
#1

it can save the code in the file
but ....

Код:
[00:49:30]  No: 0 Mod:411 2716.795898 -1483.210571 30.131399 251.607299 -1 -1 
[00:49:30]  No: 1 Mod:455 2716.795898 -1483.210571 30.131399 251.607299 -1 -1 
[00:49:30]  No: 2 Mod:404 1629.891723 -1743.112060 13.287796 141.126098 -1 -1 
[00:49:30] Number of vehicle models: 3
[00:49:50] Incoming connection: 127.0.0.1:61153
[00:49:50] [join] oshino_shinobu has joined the server (0:127.0.0.1)
[00:49:51]  
[00:49:51]  
[00:50:12]  No: 1 Mod:455 2716.795898 -1483.210571 30.131399 251.607299 -1 -1 
[00:50:15] [part] S_v has left the server (0:1)
and here is my code
Код:
forward SaveCarCoords();
public SaveCarCoords()
{
	new idx;
	idx = GetPlayerVehicleID;
	new File: file2;
	while (idx <= 2)
	{
		new coordsstring[256];
		format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d\n\r",
		CarInfo[idx][cModel],
		CarInfo[idx][cLocationx],
		CarInfo[idx][cLocationy],
		CarInfo[idx][cLocationz],
		CarInfo[idx][cAngle],
		CarInfo[idx][cColorOne],
		CarInfo[idx][cColorTwo]);
		if(idx == 0)
		{
			file2 = fopen("cars.cfg", io_write);
		}
		else
		{
			file2 = fopen("cars.cfg", io_append);
		}
		fwrite(file2, coordsstring);
		printf(" 编号: %d 模型:%d %f %f %f %f %d %d ",idx,CarInfo[idx][cModel],CarInfo[idx][cLocationx],CarInfo[idx][cLocationy],CarInfo[idx][cLocationz],CarInfo[idx][cAngle],CarInfo[idx][cColorOne],CarInfo[idx][cColorTwo]);
		idx++;
		fclose(file2);
	}
	return 1;
}
Reply


Messages In This Thread
Save Problem +REP - by peterory - 01.06.2012, 01:11
Re: Save Problem +REP - by Yuryfury - 01.06.2012, 01:47
Re: Save Problem +REP - by peterory - 01.06.2012, 02:03
Re: Save Problem +REP - by Yuryfury - 01.06.2012, 03:15
Re: Save Problem +REP - by peterory - 01.06.2012, 03:37

Forum Jump:


Users browsing this thread: 2 Guest(s)