[HELP]mysql_retrieve_row - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]mysql_retrieve_row (
/showthread.php?tid=351841)
[HELP]mysql_retrieve_row -
TheBluec0de - 17.06.2012
Normal code is:
Код:
while (mysql_retrieve_row())
{
mysql_fetch_field_row(string, "Money"); GivePlayerMoney(playerid, strval(string));
mysql_fetch_field_row(string, "Score"); SetPlayerScore(playerid, strval(string));
}
mysql_free_result();
i definied:
Код:
#define GET_INT(%1,%2) mysql_fetch_field_row(tmp, %2);%1 = strval(tmp)
and the code..
Код:
while (mysql_retrieve_row())
{
GET_INT(/* THIS */???, "Money");
GET_INT(/* THIS */???, "Score");
}
mysql_free_result();
help please ?
AW: [HELP]mysql_retrieve_row -
Nero_3D - 17.06.2012
That would work
pawn Код:
#define GET_INT(%0) (mysql_fetch_field_row(tmp, %0), strval(tmp))
pawn Код:
//
while (mysql_retrieve_row()) {
GivePlayerMoney(playerid, GET_INT("Money"));
SetPlayerScore(playerid, GET_INT("Score"));
}
mysql_free_result();