21.12.2013, 20:47
https://sampforum.blast.hk/showthread.php?tid=482492
Why did you create another thread for the same problem?
Anyways, I'll say the problems with the code you posted:
You declared target as an integer and in the sscanf is used as string even if it's not an array.
---
Empty callback and threaded queries are not used like that. You'll need to get the data in the callback was used by the function (mysql_function_query) so the best way is an array (global) and store in it true/false so the player can use it later on.
Why did you create another thread for the same problem?
Anyways, I'll say the problems with the code you posted:
pawn Код:
new target;
...
if(sscanf(params, "s[40]", target)) ...
---
pawn Код:
...
mysql_function_query(g_Handle, query, true, "", "d", target);
new rows, fields;
cache_get_data(rows, fields, g_Handle);
if(rows)
{
return true;
}
else {
return false;
}