SA-MP Forums Archive
MySQL Vehicle System Saving Bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Vehicle System Saving Bug (/showthread.php?tid=539075)



MySQL Vehicle System Saving Bug - Robi222 - 26.09.2014

Hi!

I need 1 working Vehicle System Saving,because my script is bad.

Here's my vehicle saving system,nothing save into mysql table. :/

Код:
enum carInfo
{
	vID,
	vModel,
	Float:vPosX,
	Float:vPosY,
	Float:vPosZ,
	Float:vRot,
	vCol1,
	vCol2
};
new cInfo[MAX_VEHICLES][carInfo];
Код:
CMD:vehicles(playerid, params[])
{
	VehicleSaveAll();
	return 1;
}

stock VehicleSaveAll()
{
	new query[1024],str[128];

	for(new i=0; i<sizeof(cInfo); i++)
	{
		
		GetVehiclePos(cInfo[i][vID],cInfo[i][vPosX],cInfo[i][vPosY],cInfo[i][vPosZ]);
		GetVehicleZAngle(cInfo[i][vID], cInfo[i][vRot]);
		
		format(query,sizeof(query),"UPDATE sveh SET VehX='%f',VehY='%f',VehZ='%f',VehRot='%f' WHERE ID='%d'",cInfo[i][vPosX],cInfo[i][vPosY],cInfo[i][vPosZ],cInfo[i][vRot],cInfo[i][vID]);
		mysql_function_query(dbhandle,query,true,"","");
		
		printf("Cars Saved: %d", i); 
		
		
    }
	return 1;
}
Sorry for my bad english,iam slovakian.

What is the wrong ? Thanks.