Hey...
ich bin gerade ziemlich genervt, da wenn man nach registrieren sich einloggen will,
das passwort immer falsch ist angeblich....
habe sogar aus der spieler datei rauskopiert, aber es geht einfach nicht -.-
meine codes: (Standart Filesystem)
OnPlayerRequestClass
stock CheckAccount(playerid)
{
new file[30];
format(file,sizeof(file),"/Accounts/%s.ini",GetName(playerid));
return fexist(file);
}
if(CheckAccount(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, 0xFFE500C0, "Herzlichen Wilkommen auf a Virtual Life!");
SendClientMessage(playerid, 0xFFE500C0, "Bitte Loggen sie sich ein um hier spielen zu können!");
gPlayerAccount[playerid] = 1;
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, "Login", "Bitte logge dich ein indem du dein Passwort unten eingibst.","Login","Abbruch");
}
else if(!CheckAccount(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, 0xFFE500C0, "Herzlichen Wilkommen auf a Virtual Life!");
SendClientMessage(playerid, 0xFFE500C0, "Bitte Registrieren sie sich um hier spielen zu können!");
gPlayerAccount[playerid] = 0;
ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, "Registrieren", "{FFFFFF}Willkommen bei {88AA88}E{FFFFFF}xklusiv {88AA88}R{FFFFFF}ole {88AA88}p{FFFFFF}lay,\nbitte registriere dich indem du dein gewünschtes Passwort unten eingibst.","Registrieren","Abbruch");
}
OnPlayerLogin
public OnPlayerLogin(playerid,password[])
{
new tmp[256];
new string2[128];
new sendername[MAX_PLAYER_NAME];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{//Dan kommt halt alles was zu laden ist
}
}//end while
fclose(UserFile);//close the file after everything has been read in the while
}
else
{
ShowPlayerDialog(playerid,Login,DIALOG_STYLE_INPUT,"Login","Das Passwort ist nicht korrekt! Bitte gib nun dein richtiges Passwort ein:","Login","Abbrechen");
fclose(UserFile);
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
return 1;
}
}