Login/Register kommt nicht

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Textdraw6 = TextDrawCreate(174.000, 204.311, "Login / Register");
    TextDrawLetterSize(ITextdraw6, 0.449, 1.600);
    TextDrawTextSize(ITextdraw6, 297.500, 9.625);
    TextDrawAlignment(ITextdraw6, 1);
    TextDrawColor(ITextdraw6, -1);
    //TextDrawUseBox(ITextdraw6, 1);
    //TextDrawBoxColor(ITextdraw6, 102);
    TextDrawSetOutline(ITextdraw6, 1);
    TextDrawBackgroundColor(ITextdraw6, 51);
    TextDrawFont(ITextdraw6, 1);
    TextDrawSetProportional(ITextdraw6, 1);
    TextDrawSetSelectable(ITextdraw6, true);



    public OnPlayerRegister(playerid, password[])
    {
    if(IsPlayerConnected(playerid))
    {
    StopAudioStreamForPlayer(playerid);
    TextDrawHideForPlayer(playerid, newlogin0);
    TextDrawHideForPlayer(playerid, newlogin1);
    TextDrawHideForPlayer(playerid, newlogin2);
    TextDrawHideForPlayer(playerid, newlogin3);
    TextDrawHideForPlayer(playerid, newlogin4);
    TextDrawHideForPlayer(playerid, newlogin5);
    TextDrawHideForPlayer(playerid, newlogin6);
    TextDrawHideForPlayer(playerid, newlogin7);
    TextDrawHideForPlayer(playerid, newlogin8);
    TextDrawHideForPlayer(playerid, newlogin9);
    TextDrawHideForPlayer(playerid, newlogin10);
    //WP_Hash(PlayerInfo[playerid][pKey],129,password);
    CreateAccount(playerid, PlayerInfo[playerid][pKey]);
    gPlayerLogged[playerid] = 1;
    PlayerInfo[playerid][pPasswordHashed] = 1;
    mysql_SetInt("accounts", "PasswordHashed", 1 , "Name", PlayerInfo[playerid][pIngameName]);
    GetPlayerName(playerid, PlayerInfo[playerid][pIngameName], 24);
    OnPlayerUpdate_(playerid);
    OnPlayerLogin(playerid,PlayerInfo[playerid][pKey]);


    return 1;
    }
    return 1;
    }


    public OnPlayerLogin(playerid,password[])
    {
    new string2[500];
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pIngameName], 24);
    mysql_real_escape_string(PlayerInfo[playerid][pIngameName],PlayerInfo[playerid][pIngameName]);
    if(PlayerInfo[playerid][pPasswordHashed])
    {
    //WP_Hash(string2,129,password);
    if(!strcmp(string2, mysql_ReturnPasswort(PlayerInfo[playerid][pIngameName]), true))
    {
    // Wird weiter ausgeführt
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gebe dein Passwort bitte erneut ein:","Login","Abbrechen");
    gPlayerLogTries[playerid] += 1;
    if(gPlayerLogTries[playerid] == 4) { Kick(playerid); }
    mysql_free_result();
    return 1;
    }
    }
    else if(!PlayerInfo[playerid][pPasswordHashed])
    {
    if(!strcmp(password, mysql_ReturnPasswort(PlayerInfo[playerid][pIngameName]), true))
    {
    // Wird weiter ausgeführt
    //WP_Hash(PlayerInfo[playerid][pKey],129,password);
    mysql_SetString("accounts", "Passwort", PlayerInfo[playerid][pKey], "Name", PlayerInfo[playerid][pIngameName]);
    mysql_SetInt("accounts", "PasswordHashed", 1 , "Name", PlayerInfo[playerid][pIngameName]);
    PlayerInfo[playerid][pPasswordHashed] = 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gebe dein Passwort bitte erneut ein:","Login","Abbrechen");
    gPlayerLogTries[playerid] += 1;
    if(gPlayerLogTries[playerid] == 4) { Kick(playerid); }
    mysql_free_result();
    return 1;
    }
    }




    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REG2,DIALOG_STYLE_PASSWORD,"Account erstellen","[FEHLER] Das Passwort muss min. 4 Zeichen haben.\nGib das Passwort für deinen Account ein:","OK","Abbrechen");
    }
    }
    if(dialogid == DIALOG_CHANGEPASS)
    {
    if(response)
    {
    if(PlayerInfo[playerid][pAdjustable] == 1)
    {
    if(strlen(inputtext) > 3)
    {
    new string22[128];
    format(string22, 128, "Du hast dein Passwort zu {FF1E00} %s {FFFFFF} geändert", inputtext);
    SendClientMessage(playerid, 0xFFFFFFFF, string22);
    mysql_SetString("accounts", "Passwort", inputtext, "Name", PlayerInfo[playerid][pIngameName]);
    mysql_SetInt("accounts", "PasswordHashed", 0, "Name", PlayerInfo[playerid][pIngameName]);
    return 1;
    }
    else SendClientMessage(playerid, 0xFFFFFFFF, "Dein Passwort muss mindestens 4 Zeichen lang sein.");
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du kannst dein Passwort nicht ändern, da du nicht eingeloggt bist.");
    }
    }
    }
    if(dialogid == DIALOG_CHANGEUCPPASS)
    {
    if(response)
    {
    if(PlayerInfo[playerid][pAdjustable] == 1)
    {
    if(strlen(inputtext) > 3)
    {
    new string22[128];
    format(string22, 128, "Du hast dein UCP-Passwort zu {FF1E00} %s {FFFFFF} geändert", inputtext);
    SendClientMessage(playerid, 0xFFFFFFFF, string22);
    format(PlayerInfo[playerid][pUCPPassword],16,"%s",inputtext);


    format(query,sizeof(query),"SELECT * FROM `accounts` WHERE `Name` = '%s'",PlayerInfo[playerid][pIngameName]);


    mysql_query(query);
    mysql_store_result();


    mysql_SetString("accounts", "UCPPassword", PlayerInfo[playerid][pUCPPassword], "Name", PlayerInfo[playerid][pIngameName]);
    mysql_free_result();
    return 1;