Hallo liebe Community ich habe ein Problem mit meinem login und register system und zwar wenn ich mich einloggen will kommt immer das passwort ist falsch weiß jemand woran das liegen könnte?
if(dialogid==DIALOG_REGISTER)
{
new name[MAX_PLAYER_NAME],query[128],passwort[20];
GetPlayerName(playerid,name,sizeof(name));
if(response)
{
if(strlen(inputtext)>3)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,password,level,money) VALUES ('%s',('%s'),'%i','%i')",name,MD5_Hash(passwort),1,1500);
mysql_pquery(dbhandle,query,"","");
SetPlayerScore(playerid,1);
GivePlayerMoney(playerid,1500);
}
else
{
SendClientMessage(playerid,ROT,"Dein Passwort muss mindestens 4 Zeichen lang sein!");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registrierung","Gib bitte dein gewünschtes Passwort an:","Weiter","Abbrechen");
}
}
else
{
Kick(playerid);
}
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[20];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"SELECT * FROM `user` WHERE username='%s' AND password=MD5('%s')",name,MD5_Hash(passwort));
mysql_pquery(dbhandle,query,"AccountLaden","i",playerid);
}
else
{
SendClientMessage(playerid,ROT,"Du hast kein Passwort angegeben");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Gib bitte dein Passwort ein:","Login","Abbrechen");
}
}
else
{
Kick(playerid);
}
}
public OnPlayerConnect(playerid)
{
//Register/login
new name[MAX_PLAYER_NAME],query[128];
GetPlayerName(playerid,name,sizeof(name));
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s'",name);
mysql_pquery(dbhandle,query,"AccountAnlegen","i",playerid);
return 1;
}
SpielerSpeichern(playerid)
{
if(sInfo[playerid][eingeloggt]==0)return 1;
new name[MAX_PLAYER_NAME],query[128];
GetPlayerName(playerid,name,sizeof(name));
format(query,sizeof(query),"UPDATE `user` SET `level` = '%i',`money` = '%i',`alevel` = '%i' WHERE `username` = '%s'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],name);
mysql_pquery(dbhandle,query,"","");
return 1;
}
ResetPlayer(playerid)
{
sInfo[playerid][level]=0;
sInfo[playerid][eingeloggt]=0;
sInfo[playerid][id]=0;
sInfo[playerid][alevel]=0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SpielerSpeichern(playerid);
ResetPlayer(playerid);
return 1;
}
public AccountAnlegen(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows== 0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registrierung","Gib bitte dein gewünschtes Passwort an:","Weiter","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Gib bitte dein Passwort ein:","Login","Abbrechen");
}
return 1;
}
public AccountLaden(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows== 1)
{
//paswort richtig
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
sInfo[playerid][eingeloggt] = 1;
SetPlayerScore(playerid,cache_get_field_content_int(0,"level",dbhandle));
sInfo[playerid][id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
}
else
{
//passwort falsch
SendClientMessage(playerid,ROT,"Das eingegebene Passwort ist falsch!");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Gib bitte dein Passwort ein:","Login","Abbrechen");
}
return 1;
}
Das ist das ganze sytem mit halt oben ein paar definitionen etc.?