Hi,
bei meinem Register System habe ich ein problem. Wenn ich mich registriere ist alles ok. Aber dann wenn ich gta aus und dann wieder an mach und dann mein PW eingebe kommt.
Falsches Password
Hier ist der Code
[hide]public OnPlayerLogin(playerid,const string[])
{
new pname2[MAX_PLAYER_NAME];
new pname3[MAX_PLAYER_NAME];
new string2[64];
new string3[128];
GetPlayerName(playerid, pname2, sizeof(pname2));
format(string2, sizeof(string2), "/Spieler/%s.cer", pname2);
new File: UserFile = fopen(string2, io_read);
if (UserFile)
{
new valtmp[128];
fread(UserFile, valtmp);strmid(PlayerInfo[playerid][Passwort], valtmp, 0, strlen(valtmp)-1, 255);
if ((strcmp(PlayerInfo[playerid][Passwort], string, true, strlen(valtmp)-1) == 0))
{
new key[128],val[128];
new Data[128];
while(fread(UserFile,Data,sizeof(Data)))
{
key = ini_GetKey(Data);
if( strcmp( key , "Morde" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][morde] = strval( val ); }
if( strcmp( key , "Tode" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][tode] = strval( val ); }
if( strcmp( key , "Geld" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][geld] = strval( val ); }
if( strcmp( key , "Führerschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][autoschein] = strval( val ); }
if( strcmp( key , "Leader" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][leader] = strval( val ); }
if( strcmp( key , "SkinID" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][skin] = strval( val ); }
if( strcmp( key , "Adminlevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][alevel] = strval( val ); }
GivePlayerMoney(playerid,PlayerInfo[playerid][geld]);
SpawnPlayer(playerid);
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
gPlayerAccount[playerid] = 1;
new kills = PlayerInfo[playerid][morde];
SetPlayerScore(playerid, kills);
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "Willkommen %s, du hast dich erfolgreich eingeloggt!", pname3);
SendClientMessage(playerid, Grün,string3);
}
else
{
SendClientMessage(playerid, Grau, "Das Password stimmt nicht mit dem Password des Users überein!");
fclose(UserFile);
}
}
return 1;
}[/hide]
Danke
MfG
zombie_modder