06.08.2015, 13:30
Hi there, I have a problem with my database.. (again) . I have made that when you register to spawn you on the player spawn, ok, working perfectly, then I made that when a player disconects to save it's location and import it in the database so when the player connects back he is spawned at the place where he crashed or quit. but.. when I exit the location isn't saved in the database. But it's working, selecting and everything. I hav added some location directly in database to see if it's selecting from it and inserting in the server, it's working for that. But not saving the location on exit..
This is a part of my enum
and this is the OnPlayerDisconnect function to save..
so.. what I did wrong ? And how can I repair it ? :-s
This is a part of my enum
PHP код:
Float:posX,
Float:posY,
Float:posZ,
Float:posA
PHP код:
new query[128], Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]); // getting and saving.
PHP код:
mysql_format(MySQL, query,sizeof query,"UPDATE `accounts` SET `Admin` = %d, `Tester` = %d, `Money` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `PosA` = %f WHERE `ID`=%d", Player[playerid][Admin], Player[playerid][Tester], GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]); // and all the update function..