#1

pawn Код:
stock SaveAccountVariables(playerid)
{
    new Float:a, intid, vw, Float:x, Float:y, Float:z, szQuery[1024];
    GetPlayerPos(playerid, x,y,z);
    vw = GetPlayerVirtualWorld(playerid);
    intid = GetPlayerInterior(playerid);
    GetPlayerFacingAngle(playerid, a);
    format(szQuery, sizeof(szQuery), "UPDATE `Stats` SET `AdminLevel` = %d, `seeds` = %d, `weed` = %d, `pSkin` = %d, `pTier` = %d, `pFaction` = %d, `pLastx` = %f, `pLasty` = %f, `pLastz` = %f, `pRank` = '%s', `pIP` = '%s', `pInterior` = %d, `pVirtualWorld` = %d, `Money` = %d, `pLasta` = %f AND `BanReason` = '%s' WHERE `pDatabaseID` = %d",
    pInfo[playerid][AdminLevel], pInfo[playerid][seeds], pInfo[playerid][weed], GetPlayerSkin(playerid), pInfo[playerid][pTier], pInfo[playerid][pFaction],x,y,z, pInfo[playerid][pRank], pInfo[playerid][pIP], intid, vw, GetPlayerMoney(playerid), a, pInfo[playerid][BanReason], pInfo[playerid][pDatabaseID]);
    mysql_function_query(1, szQuery, false, "", "");
}
There's my saving function, however when a player disconnects and this is called, it's just printing 0 on every float/integer and nothing on the strings, why is this?
Reply
#2

I hope you're not resetting their stuff before calling this?
Reply
#3

Nah. I have it under onplayerdisconnect and I made a command to test it.
pawn Код:
CMD:savestats(playerid, params[])
{
    SaveAccountVariables(playerid);
    return 1;
}
Reply
#4

sry double
Reply
#5

Update: If you join then reconnect and add new stats, eg admin level, skin, it will save. It's really odd and I have no clue on how to fix this.
You can also log in with whatever password you want. If someone wants to see it in action PM me for the IP.
Reply
#6

Bump, still got these issues.
Reply
#7

Bumping again, I really need this issue dealt with.
Reply
#8

Sorry for bumping, has NO ONE got a clue on how to fix this? There's got to be some MySQL pros around here.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)