Quote:
Originally Posted by Konstantinos
What's the point of selecting everything from database and until the query is executed, the player has already disconnected and GetPlayerPos should return false; hence the coordinates are 0.0
In OnPlayerDisconnect, save directly:
pawn Код:
GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]); new query[518]; mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET Admin=%d, Money=%d, posX=%f, posY=%f, posZ=%f WHERE ID=%d", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query); printf(query);
|
Thank you, it's working now.