Not Saving Pos -
Mriss - 02.05.2014
help!, my system isnt saving the position>
pawn Код:
new query[250], Float:X, Float:Y, Float:Z, Float:FacingAngle;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, FacingAngle);
mysql_format(MysqlCon, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `TrustedLevel`=%d, `Deaths`=%d, `Kills`=%d, `X`=%d, `Y`=%d, `Z`=%d, 'FacingAngle'=%d, `Interior`=%d, 'VW'=%d WHERE `ID`=%d AND `user`='%e'",
pInfo[playerid][pAdmin],
pInfo[playerid][pVip],
GetPlayerMoney(playerid),
GetPlayerScore(playerid),
pInfo[playerid][pTrustedLevel],
pInfo[playerid][pDeaths],
pInfo[playerid][pKills],
X,
Y,
Z,
GetPlayerInterior(playerid),
GetPlayerVirtualWorld(playerid),
FacingAngle,
pInfo[playerid][pID],
PlayerName(playerid));
Re: Not Saving Pos -
BroZeus - 02.05.2014
pawn Код:
new query[250], Float:X, Float:Y, Float:Z, Float:FacingAngle;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, FacingAngle);
format(query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `TrustedLevel`=%d, `Deaths`=%d, `Kills`=%d, `X`=%d, `Y`=%d, `Z`=%d, 'FacingAngle'=%d, `Interior`=%d, 'VW'=%d WHERE `ID`=%d AND `user`='%e'",
pInfo[playerid][pAdmin],
pInfo[playerid][pVip],
GetPlayerMoney(playerid),
GetPlayerScore(playerid),
pInfo[playerid][pTrustedLevel],
pInfo[playerid][pDeaths],
pInfo[playerid][pKills],
X,
Y,
Z,
GetPlayerInterior(playerid),
GetPlayerVirtualWorld(playerid),
FacingAngle,
pInfo[playerid][pID],
PlayerName(playerid));
mysql_query(query);
not sure but maybe this
Re: Not Saving Pos -
Mriss - 02.05.2014
I also did print(query), Here is what was in the Console>
Код:
[15:54:12] UPDATE `players` SET `Admin`=0, `Vip`=0, `Money`=1250, `Score`=0, `TrustedLevel`=0, `Deaths`=0, `Kills`=0, `X`=-1019816464, `Y`=1150233798, `Z`=1100791808, 'FacingAngle'=0, `Interior`=0, 'VW'=-2147483648 WHERE `ID`=2 AND `user`='Brad_Nunchr'
[15:54:12] [part] Brad_Nunchr has left the server (0:1)
Re: Not Saving Pos -
BroZeus - 02.05.2014
Oh use the format specifier of "%f" for float instead of "%d"
replace "%d" with "%f" in front of float values in format function
Re: Not Saving Pos -
awsomedude - 02.05.2014
To
Re: Not Saving Pos -
Mriss - 02.05.2014
still not working>
http://prntscr.com/3fdjak
Re: Not Saving Pos -
XK - 02.05.2014
pawn Код:
new query[250], Float:X, Float:Y, Float:Z, Float:FacingAngle;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, FacingAngle);
mysql_format(MysqlCon, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `TrustedLevel`=%d, `Deaths`=%d, `Kills`=%d, `X`=%.1f, `Y`=%.1f, `Z`=%.1f, 'FacingAngle'=%.1f, `Interior`=%d, 'VW'=%d WHERE `ID`=%d AND `user`='%e'",
pInfo[playerid][pAdmin],
pInfo[playerid][pVip],
GetPlayerMoney(playerid),
GetPlayerScore(playerid),
pInfo[playerid][pTrustedLevel],
pInfo[playerid][pDeaths],
pInfo[playerid][pKills],
X,
Y,
Z,
GetPlayerInterior(playerid),
GetPlayerVirtualWorld(playerid),
FacingAngle,
pInfo[playerid][pID],
PlayerName(playerid));
change from %d to %.1f,tested it and worked