MySQL threaded query how to get it's return?
#1

How can I get the return value of a MySQL tquery callback?

In non async query:

Код:
public OnPlayerRequestClass(playerid, classid)
{	
	// Check if the name is on our database
	// If it is -> Show login dialog
	// If not -> Tell client to register on site + kick
	if (!NameCheck(playerid)) return KickPlayer(playerid, "This name is not on our Database. Please register on our website: custom-roleplay.com");
	return 1;
}

public NameCheck(playerid) {
	new name[MAX_PLAYER_NAME + 1];
	GetPlayerName(playerid, name, sizeof(name));
	new query[128];
	mysql_format(Database, query, sizeof query, "SELECT * FROM users WHERE name = '%s'", name);
	mysql_query(Database, query);
	if (cache_num_rows() > 0) {
		return true;
	}
	return false;
}
How do I do this with the async version?
Thanks in advance!
Reply


Messages In This Thread
MySQL threaded query how to get it's return? - by Seifspeed - 21.07.2018, 20:39
Re: MySQL threaded query how to get it's return? - by MafiaOink - 21.07.2018, 20:52
Re: MySQL threaded query how to get it's return? - by Seifspeed - 21.07.2018, 20:58
Re: MySQL threaded query how to get it's return? - by Banditul18 - 21.07.2018, 21:31

Forum Jump:


Users browsing this thread: 2 Guest(s)