Problem with MySQL R41 and mysql_inline - 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: Problem with MySQL R41 and mysql_inline (
/showthread.php?tid=632251)
Problem with MySQL R41 and mysql_inline -
k2168 - 11.04.2017
Hi, I have a problem with making a script with MySQL r41 and mysql_inline.
I'm trying to make a script to check the player has an account or not.
And when I call mysql_tquery_inline after restart the server, It's not working and not checking the account. But, If I call mysql_tquery without inline after restart, It's working and checking the account perfectly.
What should I do to solve this problem?
Here's the code.
Код:
stock CheckAccount(playerid)
{
new
name[MAX_PLAYER_NAME],
query[120]
;
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
mysql_format(g_SQL, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Username` = '%e' LIMIT 1", name);
inline OnAccountDataLoaded()
{
if(cache_num_rows() > 0)
{
cache_get_value(0, "Password", Player[playerid][Pass], 65);
cache_get_value(0, "Salt", Player[playerid][Salt], 17);
ShowPlayerLoginDialog(playerid);
}
else
{
ShowPlayerRegisterDialog(playerid);
}
}
mysql_tquery_inline(g_SQL, query, using inline OnAccountDataLoaded, "");
return 1;
}
Re: Problem with MySQL R41 and mysql_inline -
AndreiWow - 11.04.2017
Here is a tutorial on threaded queries
https://sampforum.blast.hk/showthread.php?tid=548986