Quote:
Originally Posted by iLearner
PHP код:
new query[70];
mysql_format(g_SQL, query, sizeof query, "UPDATE `players` SET `owner` = %d,`health` = %d WHERE `id` = %d LIMIT 1", Player[playerid][Owner],Player[playerid][Health], Player[playerid][ID]);
mysql_tquery(g_SQL, query, "", "");
|
Health is NOT an integer! Also mysql_tquery doesn't need the "" if those parameters are empty as they are optional. See:
https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_tquery
It's odd to me that there are no errors from this if it isn't saving...
Код:
new query[80];
mysql_format(g_SQL, query, sizeof query, "UPDATE `players` SET `owner` = %d,`health` = %.1f WHERE `id` = %d LIMIT 1", Player[playerid][Owner], Player[playerid][Health], Player[playerid][ID]);
mysql_tquery(g_SQL, query);
Your Player[playerid][Health] variable is set as a float when declared, right? Also are you getting the player's health and storing it to that variable prior to this query being executed?