21.07.2018, 20:52
Just create a callback and do shit there rather than on player class selection. Waiting for the query to complete makes threading useless (tquery and waiting for the query to complete for the result)
Код:
public OnPlayerRequestClass(playerid, classid) { 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_tquery(Database, query, "OnPlayerNameCheck", "i", playerid); return 1; } forward public OnPlayerNameCheck(playerid); public OnPlayerNameCheck(playerid) { if(cache_num_rows() > 0) { ShowPlayerCharacterSleection or whatever(); // name exist } else { SendClientMessage(playerid, color_red, "this account doesnt exist...."); // name doesnt exist } return 1; }