Tag liebe Leute,
ich habe das Problem, dass das Script immer ausgibt ich hätte mein Passwort falsch eingeben welches aber richtig eingegeben wurde(Mehrmals getestet)
Hier einmal die Codes dazu:
public OnPasswordResponse(playerid)
{
new num_fields, num_rows;
new str[256];
cache_get_data(num_rows, num_fields);
if(num_rows == 0)
{
if(SpielerInfo[playerid][pLoginTry] == 0)
{
SendClientMessage(playerid,Rot, "Error: {FFFFFF}The entered password is wrong. | Try 1 of 3");
format(str,sizeof(str),"{FFFFFF}Welcome back {FF7800}%s!\n\n{FFFFFF}A account under this name is already registered in the Server Database.\nIf this not your Account, please take a different Name to play on this Server.\nPlease enter your password:",getPlayerName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FF7800}TRP - Login",str,"Login","Cancel");
SpielerInfo[playerid][pLoginTry] ++;
return 1;
}
if(SpielerInfo[playerid][pLoginTry] == 1)
{
SendClientMessage(playerid,Rot, "Error: {FFFFFF}The entered password is wrong. | Try 2 of 3");
format(str,sizeof(str),"{FFFFFF}Welcome back {FF7800}%s!\n\n{FFFFFF}A account under this name is already registered in the Server Database.\nIf this not your Account, please take a different Name to play on this Server.\nPlease enter your password:",getPlayerName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FF7800}TRP - Login",str,"Login","Cancel");
SpielerInfo[playerid][pLoginTry] ++;
return 1;
}
if(SpielerInfo[playerid][pLoginTry] == 2)
{
SendClientMessage(playerid,Rot, "Error: {FFFFFF}The entered password is wrong. | Try 3 of 3");
format(str,sizeof(str),"{FFFFFF}Welcome back {FF7800}%s!\n\n{FFFFFF}A account under this name is already registered in the Server Database.\nIf this not your Account, please take a different Name to play on this Server.\nPlease enter your password:",getPlayerName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FF7800}TRP - Login",str,"Login","Cancel");
SpielerInfo[playerid][pLoginTry] ++;
return 1;
}
if(SpielerInfo[playerid][pLoginTry] == 3)
{
SendClientMessage(playerid,Rot,"Error: {FFFFFF}The entered password was to often wrong. You have been kicked.");
SetTimerEx("KickTimer",500,false,"i",playerid);
SpielerInfo[playerid][pLoginTry] = 0;
return 1;
}
}
else
{
LoadAccount(playerid);
if(IsPlayerAnAdmin(playerid))
SendClientMessage(playerid,Gelb,"[SInfo] {FFFFFF}You are an Admin.");
}
return 1;
}
new str[256];
cache_get_data(num_rows, num_fields);
if(num_rows == 0)
{
if(SpielerInfo[playerid][pLoginTry] == 0)
{
SendClientMessage(playerid,Rot, "Error: {FFFFFF}The entered password is wrong. | Try 1 of 3");
format(str,sizeof(str),"{FFFFFF}Welcome back {FF7800}%s!\n\n{FFFFFF}A account under this name is already registered in the Server Database.\nIf this not your Account, please take a different Name to play on this Server.\nPlease enter your password:",getPlayerName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FF7800}TRP - Login",str,"Login","Cancel");
SpielerInfo[playerid][pLoginTry] ++;
return 1;
}
if(SpielerInfo[playerid][pLoginTry] == 1)
{
SendClientMessage(playerid,Rot, "Error: {FFFFFF}The entered password is wrong. | Try 2 of 3");
format(str,sizeof(str),"{FFFFFF}Welcome back {FF7800}%s!\n\n{FFFFFF}A account under this name is already registered in the Server Database.\nIf this not your Account, please take a different Name to play on this Server.\nPlease enter your password:",getPlayerName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FF7800}TRP - Login",str,"Login","Cancel");
SpielerInfo[playerid][pLoginTry] ++;
return 1;
}
if(SpielerInfo[playerid][pLoginTry] == 2)
{
SendClientMessage(playerid,Rot, "Error: {FFFFFF}The entered password is wrong. | Try 3 of 3");
format(str,sizeof(str),"{FFFFFF}Welcome back {FF7800}%s!\n\n{FFFFFF}A account under this name is already registered in the Server Database.\nIf this not your Account, please take a different Name to play on this Server.\nPlease enter your password:",getPlayerName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FF7800}TRP - Login",str,"Login","Cancel");
SpielerInfo[playerid][pLoginTry] ++;
return 1;
}
if(SpielerInfo[playerid][pLoginTry] == 3)
{
SendClientMessage(playerid,Rot,"Error: {FFFFFF}The entered password was to often wrong. You have been kicked.");
SetTimerEx("KickTimer",500,false,"i",playerid);
SpielerInfo[playerid][pLoginTry] = 0;
return 1;
}
}
else
{
LoadAccount(playerid);
if(IsPlayerAnAdmin(playerid))
SendClientMessage(playerid,Gelb,"[SInfo] {FFFFFF}You are an Admin.");
}
return 1;
}
if(dialogid == DIALOG_LOGIN)
{
if(!response)
{
SendClientMessage(playerid,Rot,"Error: {FFFFFF}You have canceled the Login. Please login to play on this Server.");
SetTimerEx("KickTimer",500,false,"i",playerid);
return 1;
}
format(key,sizeof(key),"%s",inputtext);
mysql_format(Handle,query,sizeof(query),"SELECT * FROM user WHERE username='%e' AND password=MD5('%e')",getPlayerName(playerid),key);
mysql_pquery(Handle,query,"OnPasswordResponse","i",playerid);
}
SQL
[21:22:04] [DEBUG] mysql_format - connection: 1, len: 125, format: "SELECT * FROM user WHERE username='%e' AND password=MD5('%e')"[21:22:04] [DEBUG] mysql_pquery - connection: 1, query: "SELECT * FROM user WHERE username='caze' AND password=MD5('test'", callback: "OnPasswordResponse", format: "i"[21:22:04] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - starting query execution[21:22:04] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - query was successfully executed within 0.231 milliseconds[21:22:04] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:22:04] [DEBUG] Calling callback "OnPasswordResponse"..[21:22:04] [DEBUG] cache_get_data - connection: 1[21:22:04] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:22:06] [DEBUG] mysql_format - connection: 1, len: 125, format: "SELECT * FROM user WHERE username='%e' AND password=MD5('%e')"[21:22:06] [DEBUG] mysql_pquery - connection: 1, query: "SELECT * FROM user WHERE username='caze' AND password=MD5('test'", callback: "OnPasswordResponse", format: "i"[21:22:06] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - starting query execution[21:22:06] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - query was successfully executed within 0.246 milliseconds[21:22:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:22:06] [DEBUG] Calling callback "OnPasswordResponse"..[21:22:06] [DEBUG] cache_get_data - connection: 1[21:22:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:22:07] [DEBUG] mysql_format - connection: 1, len: 125, format: "SELECT * FROM user WHERE username='%e' AND password=MD5('%e')"[21:22:07] [DEBUG] mysql_pquery - connection: 1, query: "SELECT * FROM user WHERE username='caze' AND password=MD5('test'", callback: "OnPasswordResponse", format: "i"[21:22:07] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - starting query execution[21:22:07] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - query was successfully executed within 0.259 milliseconds[21:22:07] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:22:07] [DEBUG] Calling callback "OnPasswordResponse"..[21:22:07] [DEBUG] cache_get_data - connection: 1[21:22:07] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:22:08] [DEBUG] mysql_format - connection: 1, len: 125, format: "SELECT * FROM user WHERE username='%e' AND password=MD5('%e')"[21:22:08] [DEBUG] mysql_pquery - connection: 1, query: "SELECT * FROM user WHERE username='caze' AND password=MD5('test'", callback: "OnPasswordResponse", format: "i"[21:22:08] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - starting query execution[21:22:08] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse] - query was successfully executed within 0.283 milliseconds[21:22:08] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:22:08] [DEBUG] Calling callback "OnPasswordResponse"..[21:22:08] [DEBUG] cache_get_data - connection: 1[21:22:08] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
Danke im Voraus