SA-MP Forums Archive
Fixed. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fixed. (/showthread.php?tid=227613)



Fixed. - KaleOtter - 17.02.2011

Fixed


Re: Mysql Floats? - Hal - 17.02.2011

Quote:
Originally Posted by KaleOtter
Посмотреть сообщение
Hello again a question about mysql.
I got a table with vehicles in my database.
They works fine, they get loaded and saved well.
But when I make a new vehicle ingame and I reload the gamemode, everything get saved except the position?
The X Y Z A floats in my database keeps on 0.
And yes I'm sure those floats are set in my gamemode so there aren't 0 when I save it.
Is there something special about floats and mysql?
Query:
Код:
				format(VehiclesQuery, sizeof(VehiclesQuery), "UPDATE `vehicles` SET `CarModel` = %d, `CarX` = '%f', `CarY` = '%f', `CarZ` = '%f', `CarA` = '%f', `CarColor1` = %d, `CarColor2` = %d, `FactionCar` = %d, `FamilyCar` = %d, `CarType` = %d, `Plates` = '%s' WHERE `VehicleNumber` = %d",
		 		vStats[id][CarModel],
		        vStats[id][CarX],
		        vStats[id][CarY],
		        vStats[id][CarZ],
		        vStats[id][CarAngle],
		        vStats[id][CarColor1],
		        vStats[id][CarColor2],
		        vStats[id][FactionCar],
		        vStats[id][FamilyCar],
		        vStats[id][CarType],
		        vStats[id][Plates],
		        vStats[id][VehicleNumber]);
		        mysql_query(VehiclesQuery);
Make sure you set the field type to Float.


Re: Fixed. - KaleOtter - 17.02.2011

I have that but the problem is not in database or query but in server script.