No coordinates are saved
#1

Attempt to save the coordinates when get off the car. Are saved but when I restart the server the cars appear disorderly, where is the error?

Sorry for my English


Код:
OnPlayerExitVehicle(playerid,vehicleid)
{
  new idcoche;
  idcoche = GetPlayerVehicle (playerid);
  new Float:x,Float:y,Float:z, Float:angulo;
  GetVehiclePos(idcoche, x, y, z);
  GetVehicleZAngle(idcoche, angulo);
  CarInfo[idcoche][cLocationx]=x;
  CarInfo[idcoche][cLocationy]=y;
  CarInfo[idcoche][cLocationz]=z;
  CarInfo[idcoche][cAngle] = angulo;					
  GuardarCoordenadasCoche(idcoche);
}
GuardarCoordenadasCoche(idx)
{
	//new tmp[128];
	
    new sql[2048];
	format(sql, sizeof(sql), "UPDATE cars SET X=%f,Y=%f,Z=%f,A=%f WHERE `id`=%d",
        CarInfo[idx][cLocationx],
		CarInfo[idx][cLocationy],
		CarInfo[idx][cLocationz],
		CarInfo[idx][cAngle],
		CarInfo[idx][cSQLID]);
	mysql_query(sql);
	return 1;
}
Reply


Messages In This Thread
No coordinates are saved - by Narxon - 16.05.2011, 00:30
Re: No coordinates are saved - by DRIFT_HUNTER - 16.05.2011, 00:46
Respuesta: No coordinates are saved - by Narxon - 16.05.2011, 00:52
Respuesta: No coordinates are saved - by Narxon - 16.05.2011, 14:24
Re: No coordinates are saved - by xDeadlyBoy - 16.05.2011, 14:30
Re: No coordinates are saved - by NRJ53 - 16.05.2011, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)