25.09.2016, 19:25
Hello
I have two questions
when saving an account OnPlayerDisconnect,
It is better to use mysql_function_query or mysql_query?
I've never used this
OR
I have always used this way, okay well?
other question:
rarely (almost never), some players lose their statistics.
It happens 1 time in 10000 so to speak, this only happens with statistics that are saved when the player is disconnected, for example score, money, etc.
thanks
I have two questions
when saving an account OnPlayerDisconnect,
It is better to use mysql_function_query or mysql_query?
I've never used this
PHP Code:
public SavePlayer(playerid)
{
new query[100];
mysql_format(db, query, sizeof(query), "UPDATE `players` SET money = %d, score = %d WHERE `nick` = '%e'", Money[playerid], Score[playerid], name(playerid));
mysql_query(db, query, false);
return 1;
}
I have always used this way, okay well?
PHP Code:
public SavePlayer(playerid)
{
new query[100];
mysql_format(db, query, sizeof(query), "UPDATE `players` SET money = %d, score = %d WHERE `nick` = '%e'", Money[playerid], Score[playerid], name(playerid));
mysql_function_query(db, query, false, "", "");
return 1;
}
rarely (almost never), some players lose their statistics.
It happens 1 time in 10000 so to speak, this only happens with statistics that are saved when the player is disconnected, for example score, money, etc.
PHP Code:
new query[100];
mysql_format(db, query, sizeof(query), "UPDATE `players` SET money = %d, score = %d WHERE `nick` = '%e'", Money[playerid], Score[playerid], name(playerid));
mysql_function_query(db, query, false, "", "");