21.09.2016, 12:11
Quote:
Unless you get the player's position in a timer and store it to global array, you can't retrieve them when the client crashes/timeouts.
Another option is what I did in the example script: using the last saved position: https://github.com/pBlueG/SA-MP-MySQ....pwn#L343-L349 |
PHP код:
mysql_format(ServerMySQL,query1,sizeof(query1),"UPDATE `Users` SET `Name` = '%s', `pIP` = '%s', `pCash` = '%d', `pAdmin` = '%d', `pXPos` = '%f', `pYPos` = '%f', `pZPos` = '%f', `pAPos` = '%f', `Interior` = '%d' WHERE `Name` = '%s'",GetName(playerid),playerip[playerid],cash,PlayerInfo[playerid][pAdmin], pos[0], pos[1], pos[2], pos[3],PlayerInfo[playerid][Interior],GetName(playerid));
PHP код:
mysql_format(ServerMySQL,query1,sizeof(query1),"UPDATE `Users` SET Name ='%s', pIP='%s',pCash = %d, pAdmin=%d, pXPos = %f, pYPos = %f, pZPos = %f, pAPos = %f,Interior=%d WHERE Name = '%s'",GetName(playerid),playerip[playerid],cash,PlayerInfo[playerid][pAdmin], pos[0], pos[1], pos[2], pos[3],PlayerInfo[playerid][Interior],GetName(playerid));