31.07.2016, 05:22
Quote:
|
What is this Nameid?
Change it to inputtext or nlocalreffer And in your CheckRefferExist there are 2 params while you gave 3 in tquery PHP код:
|
Quote:
|
You dont even ask if the player exsits.
I dont know your mysql plugin version so well, send me the code where you check if the username exists when a player is connecting to your server and i will fix the referrer problem for you. |
Код:
public OnPlayerConnect(playerid) {
new query[512];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Username` = '%s'", Nome(playerid) ); //SELECT * FROM accounts WHERE Name = %s TROQUE PELA QUAL ESTA NO SEU BANCO DE DADOS
mysql_function_query(ConnectMYSQL, query, true, "OnConnection","i",playerid);
Код:
forward OnConnection(playerid); public OnConnection(playerid) {
new rows, fields;
cache_get_data(rows, fields);
if(rows) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Your account has been found - Log-in", "Your account has been found in our database.\nPlease insert your password to continue.", "Log-in", "Quit");
}
else {
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Your account hasn't been found - Register", "Your account couldn't be found in our database.\nPlease insert a new password to complete the registration.", "Register", "Quit");
}
return 1;
}


