On Player Crash
#5

Quote:
Originally Posted by Campbell-
Посмотреть сообщение
  1. It doesn't matter whether the player crashes, gets kicked/banned, times out or disconnects. The functions GetPlayerScore(), GetPlayerMoney(), ... work at all times in the OnPlayerDisconnect()-Callback. There is no need to save any data at all times in other data structures just for the case that a player crashes.
  2. Threaded queries are not faster at all. They just get processed on another thread of the process running to avoid the actual script to stop until the query is fully processed.
  3. Why are you still using BlueG's MySQL R5? It is outdated, filled with bugs and less efficient with less functionality.
  4. The code below works just fine ...
pawn Код:
public OnPlayerDisconnect(playerid, reason) {
    saveData(playerid);
    return 1;
}

saveData(playerid) {
    // BlueG's MySQL Plugin R38
    new query[100];
    mysql_format(handle, query, sizeof(query), "UPDATE `samp_users` SET `pScore` = %i, `pMoney` = %i WHERE `pID` = %i;", GetPlayerScore(playerid), GetPlayerMoney(playerid), playerDatabaseID);
    mysql_tquery(handle, query, "", "");
}
thanks for your explaination.....
+REP for all
Reply


Messages In This Thread
On Player Crash - by AiRaLoKa - 16.05.2014, 08:25
Re: On Player Crash - by Lordzy - 16.05.2014, 08:33
Re: On Player Crash - by AiRaLoKa - 16.05.2014, 09:14
Re: On Player Crash - by Campbell- - 16.05.2014, 09:32
Re: On Player Crash - by AiRaLoKa - 16.05.2014, 12:05

Forum Jump:


Users browsing this thread: 1 Guest(s)