SA-MP Forums Archive
savepos - 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: savepos (/showthread.php?tid=632514)



savepos - 7daan71 - 15.04.2017

Hello guys,

I currently have a savepos system in mysql that saves your positition on registration and can load it without a problem. The only thing that doesn't work is saving the position OnPlayerDisconnect. When I log out the data at the table doesn't change. This is my code:

Код:
new DB_Query[256];
GetPlayerPos(playerid, pData[playerid][PosX], pData[playerid][PosY], pData[playerid][PosZ]);
mysql_format(MYSQL_CONNECT, DB_Query, sizeof(DB_Query), "UPDATE `Players` SET `PosX` = %f, `PosY` = %f, `PosZ` = %f WHERE `SQLID` = %d LIMIT 1", pData[playerid][PosX], pData[playerid][PosY], pData[playerid][PosZ], pData[playerid][SQLID]);



Re: savepos - 7daan71 - 15.04.2017

I have changed the quotes and removed the LIMIT clause but still, it doesn't work. If OnPlayerDisconnect can cause problems sometimes, where would you save the data then? I am still very new at MYSQL so I do not fully understand how many cells the query needs.