04.02.2015, 18:36
Hey guys
Iґve got a small problem with MySQL, I can read and set floats in the DB, but it always is rounding up/down itself.
I couldnt find a fix yet, does someone know how to fix it?
Iґve got a small problem with MySQL, I can read and set floats in the DB, but it always is rounding up/down itself.
I couldnt find a fix yet, does someone know how to fix it?
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new Query[256];
GetPlayerPos(playerid, pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ]);
mysql_format(mysql, Query, sizeof(Query), "UPDATE accounts SET Score='%d', VIP='%d', Money='%d', PosX='%f', PosY='%f', PosZ='%f' WHERE ID='%d'",
pInfo[playerid][Score], pInfo[playerid][VIP], GetPlayerMoney(playerid), pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ], pInfo[playerid][ID]);
printf("%s", Query);
mysql_tquery(mysql, Query, "", "");
return 1;
}
PHP код:
pInfo[playerid][posX] = cache_get_field_content_float(0, "PosX");
pInfo[playerid][posY] = cache_get_field_content_float(0, "PosY");
pInfo[playerid][posZ] = cache_get_field_content_float(0, "PosZ");
pInfo[playerid][FacingAng] = cache_get_field_content_float(0, "FacingAngel");