Mysql Abpspeicher Problem.. Login Register

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
  • Guten Tag,


    Habe ein Problem mit dem Login Register System...
    Eine MYSQL Daten besteht bereits, nur leider wird darin nichts gespeichert somit wird beim Nächsten login auhc nichts geladen..


    So dass sind die Teile:
    public PlayerRegister(playerid,password[])
    {
    new name[MAX_PLAYER_NAME],string[128],EscapedName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(string, sizeof(string), password);
    mysql_real_escape_string(name, EscapedName);
    new site1[400];
    new site2[400];
    new string2[800];
    format(site1, sizeof(site1), "INSERT INTO `farl`.`samp_users` (`Name`, `Passwort`, `Konto`, `Geld`, `Job`, `HNummer`, `Fahrschein`, `Flugschein`,`Bootsschein`, `LKWschein`, `EP`, `Level`, `Waffenschein`, `Leader`, `Member`, `Rank`, `Verbrechen`, `Tode`, `CrimePoints`, `PDZeit`, `Adminlevel`, `Geschlecht`, `Skin`, `Knastzeit`, `bHaus`, `mHaus`,`Autos`) VALUES");
    format(site2, sizeof(site2), " ('%s', '%s', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')", EscapedName, string);
    format(string2, sizeof(string2), "%s%s",site1,site2);
    mysql_query(string2);

    ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "{FFA500}Registration [Geschlecht]" ,"{FFFFFF}Männlich\nWeiblich", "Weiter", "Abbruch");
    return 1;
    }


    public PlayerLogin(playerid,password[])
    {
    new passwort[256];
    new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    GetFromAccount(name, "Passwort", passwort);
    format(string, sizeof(string), password);
    if(!strcmp(string, passwort, true))
    {
    new str[512];
    new load[256];
    format(load,sizeof(load),"SELECT * FROM `samp_users` WHERE `Name` = '%s'",name);
    mysql_query(load);
    mysql_store_result();
    while(mysql_fetch_row(str))
    {
    sscanf(str, "e<p<|>{s[50]}{s[50]}iiiiiiiiiiiiiiiiiiiiiiiii>",Player[playerid]);
    }
    mysql_free_result();
    GivePlayerMoney(playerid,Player[playerid][Geld]);
    new plevel = Player[playerid][Level];
    SetPlayerScore(playerid,plevel);
    SpawnPlayer(playerid);

    }
    else
    {
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "{FFA500}Login" ,"{AB0000}Falsches Passwort!{FFFFFF}\nDu hast ein Falsches Passwort eingegeben.\nGebe dein Passwort erneut ein.\nSollte es Probleme geben melde dich im Forum.", "OK", "Abbruch");
    }
    return 1;
    }



    public PlayerUpdate(playerid)
    {
    if(IsPlayerConnected(playerid) && PlayerIsLogin[playerid] == 1)
    {
    new name[MAX_PLAYER_NAME];
    new EscapedName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    mysql_real_escape_string(name, EscapedName);
    Player[playerid][Geld] = GetPlayerMoney(playerid);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Konto` = %d WHERE `Name` = '%s'",Player[playerid][Konto],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Geld` = %d WHERE `Name` = '%s'",Player[playerid][Geld],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Job` = %d WHERE `Name` = '%s'",Player[playerid][Job],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `HNummer` = %d WHERE `Name` = '%s'",Player[playerid][HNummer],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Fahrschein` = %d WHERE `Name` = '%s'",Player[playerid][Fahrschein],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Flugschein` = %d WHERE `Name` = '%s'",Player[playerid][Flugschein],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Bootsschein` = %d WHERE `Name` = '%s'",Player[playerid][Bootsschein],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `LKWschein` = %d WHERE `Name` = '%s'",Player[playerid][LKWschein],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `EP` = %d WHERE `Name` = '%s'",Player[playerid][EP],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Level` = %d WHERE `Name` = '%s'",Player[playerid][Level],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Waffenschein` = %d WHERE `Name` = '%s'",Player[playerid][Waffenschein],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Leader` = %d WHERE `Name` = '%s'",Player[playerid][Leader],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Member` = %d WHERE `Name` = '%s'",Player[playerid][Member],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Rank` = %d WHERE `Name` = '%s'",Player[playerid][Rank],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Verbrechen` = %d WHERE `Name` = '%s'",Player[playerid][Verbrechen],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Tode` = %d WHERE `Name` = '%s'",Player[playerid][Tode],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `CrimePoints` = %d WHERE `Name` = '%s'",Player[playerid][CrimePoints],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `PDZeit` = %d WHERE `Name` = '%s'",Player[playerid][PDZeit],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Adminlevel` = %d WHERE `Name` = '%s'",Player[playerid][Adminlevel],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Geschlecht` = %d WHERE `Name` = '%s'",Player[playerid][Geschlecht],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Skin` = %d WHERE `Name` = '%s'",Player[playerid][Skin],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Knastzeit` = %d WHERE `Name` = '%s'",Player[playerid][Knastzeit],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `bHaus` = %d WHERE `Name` = '%s'",Player[playerid][bHaus],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `mHaus` = %d WHERE `Name` = '%s'",Player[playerid][mHaus],EscapedName); mysql_query(Query);
    format(Query, sizeof(Query), "UPDATE `samp_users` SET `Autos` = %d WHERE `Name` = '%s'",Player[playerid][Autos],EscapedName); mysql_query(Query);
    }
    return 1;
    }


    Wer kann mir da helfen ?!?

  • Hör auf zupushen und denk selbst nach.
    "Invalid connection handle" erklärt doch alles.
    Du musst noch in deiner Funktion die MySQL-Verbindungsnummer angeben. Ich kenne dein Plugin nicht, aber ich schätze mal, dass mysql_connect die ID ausgibt.

    Kalcor: "... it makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."

  • Warscheinlich in deiner Funktion als ersten oder letzten Parameter, schau halt in die Dokumentation.

    Kalcor: "... it makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen