19.07.2016, 08:33
Whenever I disconnect, my stats do not save.
I don't see why they wouldn't especially when I dont get a SQL error.
My SQL debug:
Heres the code:
I don't see why they wouldn't especially when I dont get a SQL error.
My SQL debug:
Код:
[04:29:28] CMySQLHandler::Query(UPDATE accounts SET Level=5, Cash=0, bank=0, pX=-931.063110, pY=-502.347808, pZ=25.960937, FAngle=0.000000,pInterior=0, pVW=280,Skin=70 WHERE Username = '') - Successfully executed. [04:29:28] >> mysql_query( Connection handle: 1 )
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(pData[playerid][LoggedIn] == 1)
{
new pLevel = pData[playerid][Level];
new pCash = pData[playerid][Cash];
new pBank = pData[playerid][Bank];
new pInterior = GetPlayerInterior(playerid);
new pVirtualWorld = GetPlayerVirtualWorld(playerid);
new PlayersSkin = pData[playerid][pSkin];
new Float: f_PlayerPos[3];
GetPlayerPos(playerid, f_PlayerPos[0], f_PlayerPos[1], f_PlayerPos[2]);
new query[500], pname[32];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "UPDATE accounts SET Level=%d, Cash=%d, bank=%d, pX=%f, pY=%f, pZ=%f, FAngle=%f,pInterior=%d, pVW=%d,Skin=%d WHERE Username = '%s'", pLevel, pCash, pBank,f_PlayerPos[0], f_PlayerPos[1], f_PlayerPos[2], pInterior,pVirtualWorld,PlayersSkin,pname);
mysql_query(query);
GetWeapons(playerid);
}
return 1;
}