Accounts Won't Save OnPlayerDisconnect
#1

Account will not save when player disconnects.

Код:
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;
}
And, under OnPlayerDisconnect, I call the save function.
Reply


Messages In This Thread
Accounts Won't Save OnPlayerDisconnect - by Allura - 04.08.2016, 21:54
Re: Accounts Won't Save OnPlayerDisconnect - by AndySedeyn - 04.08.2016, 22:03
Re: Accounts Won't Save OnPlayerDisconnect - by Vince - 04.08.2016, 22:18

Forum Jump:


Users browsing this thread: 1 Guest(s)