File write error
#1

Hello, i am making script to create & save vechiles locations... And i have an error

I am getting fallowing errors:
Код:
C:\Documents and Settings\Martynas\Desktop\samp\gamemodes\timertest.pwn(62) : warning 213: tag mismatch
C:\Documents and Settings\Martynas\Desktop\samp\gamemodes\timertest.pwn(63) : warning 213: tag mismatch
C:\Documents and Settings\Martynas\Desktop\samp\gamemodes\timertest.pwn(64) : warning 213: tag mismatch
With the fallowing code, and i have no ideas what can be wrong
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[128], idx;
	cmd = strtok(cmdtext, idx);
	
	if (strcmp(cmd, "/add", true) == 0)
	{
		new tmp[128];
		tmp = strtok(cmdtext, idx);
		
		if (strlen(tmp) == 0)
			return SendClientMessage(playerid, 0xFFFFFFFF, "Naudojimas: /add <pavadinimas>");

		new line[128];
		new Float:car_x, Float:car_y, Float:car_z, Float:car_a;
		new cid = GetPlayerVehicleID(playerid);
		
		GetVehiclePos(cid, car_x, car_y, car_z);
		GetVehicleZAngle(cid, car_a);
		
		// This is 62,64 lines....................
		format(line, sizeof(line), "%s,	%d,	%f,	%f,	%f,	%f", tmp,cid,car_x,car_y,car_z,car_a);
		new gFile = fopen("vechiles.txt", io_write);
		fwrite(gFile, line);
		fclose(gFile);
		
	  SendClientMessage(playerid, COLOR_WHITE, line);
	  return 1;
	}
	
	if (strcmp(cmd, "/swn", true) == 0)
	{
	  new Float:px, Float:py, Float:pz;
	  
	  GetPlayerPos(playerid, px, py, pz);
	  px = px + 2.0;
	  py = py + 2.0;
	  pz = pz + 2.0;
		
		CreateVehicle(549, px, py, pz, 180.0, 68, 68, 800);

		return 1;
	}

	return 0;
}
CAn anyone help me?
Reply
#2

Код:
new gFile = fopen("vechiles.txt", io_write);
to

Код:
new File:gFile = fopen("vechiles.txt", io_write);
Reply
#3

Thanks But i fixed it by my self :P new File:vechiles = fopen("vechiles.txt", io_append)... :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)