It doesnt save position when someone register -
anou1 - 20.01.2014
Hi,
I got a problem, when someone register, it doesnt save his position X,Y,Z when he disconnect and I can't find why.
But when the player is already registered, it saves his position well.
I don't understand what's wrong with this
Pastbin:
http://pastebin.com/HdLWTiia
If you need the entire pastbin just tell me.
Could you please help me with this ?
Thank you !
Re: It doesnt save position when someone register -
Miguel - 20.01.2014
Hi, I looked at your code and noticed that data saving relies on an ID.
pawn Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `joueurs` SET `Admin`=%d,\
`VIP`=%d, `Argent`=%d, `posX`=%f, `posY`=%f, `posZ`=%f, `Interieur`=%i,\
`World`=%i, `Skin`=%d, `Niveau`=%d WHERE `ID`=%d", pInfo[playerid][Admin],
pInfo[playerid][VIP], pInfo[playerid][Argent], pos[0], pos[1], pos[2], GetPlayerInterior(playerid),
GetPlayerVirtualWorld(playerid), pInfo[playerid][Skin], pInfo[playerid][Niveau], pInfo[playerid][ID]);
If you track this ID, you will see that it's loaded at OnAccountCheck and nowhere else. I'm guessing that this database ID is not loaded when a player signs up for the first time.
Try this:
@OnAccountLoad
pawn Код:
pInfo[playerid][ID] = cache_get_row_int(0, 0);
... and tell if it works!
Re: It doesnt save position when someone register -
anou1 - 20.01.2014
Thank you, I will try this tomorrow, could anyone tell me who could I make a callback that can save the players data if the game mode exit ?
Thank you
EDIT: I tried to add "pInfo[playerid][ID] = cache_get_row_int(0, 0);"
And now it works fine ! Thank you.