04.08.2016, 21:54
Account will not save when player disconnects.
And, under OnPlayerDisconnect, I call the save function.
Код:
forward SaveAccount(playerid); public SaveAccount(playerid) { new query[300], Float:pos[4], playerip[16]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]); GetPlayerIp(playerid, playerip, sizeof(playerip)); mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `Name` = '%e', `Password` = '%e', `IP` = '%e', `Admin` = %d, `Money` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `PosA` = %f WHERE `ID` = %d", Player[playerid][Name], Player[playerid][Password], playerip, Player[playerid][Admin], GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]); mysql_tquery(mysql, query, "", ""); return true; }