21.04.2018, 17:45
Ahh! I didn't really read into your code but now I see the error
To use this query properly you need to do this
Now the callback should look like this
I can also teach you mysql_tquery_inline if you wish.
It will not use external callbacks but inline callbacks
PHP код:
mysql_format(database, query, sizeof query, "SELECT * FROM `users` WHERE `username` = %e LIMIT 1", pInfo[playerid][pUsername]);
mysql_tquery(database, query); // You are not using a callback
PHP код:
mysql_format(database, query, sizeof query, "SELECT * FROM `users` WHERE `username` = %e LIMIT 1", pInfo[playerid][pUsername]);
mysql_tquery(database, query, "OnPlayerCheckAccount", "d", playerid);
PHP код:
forward OnPlayerCheckAccount(playerid);
public OnPlayerCheckAccount(playerid){
if(cache_num_rows()){
cache_get_value(0, "password", PlayerData[playerid][password], MAX_PASS);
cache_get_value(0, "salt", PlayerData[playerid][salt], MAX_SALT);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD); // you know the rest
}else{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Enter passowrd", "Submit", "");
}
return 1;
}
It will not use external callbacks but inline callbacks