MySQL Registierung und Login funktioniert nicht ganz.

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
  • Hey Leute. Ich habe ein komisches Problem bekommen, dass erst vor kurzem auftrat.
    Ich kann mich garnicht mehr einloggen oder registrieren.
    Also die Dialoge kommen ja, das Problem aber:

    -Beim Registrieren:
    Register Dialog kommt, erstes mal Passwort eingeben *okay*, zweites Passwort zur bestätigung *sagt passwort ist falsch*
    Und es wird nichts mehr in der Datenbank eingetragen.

    -Beim Login:
    Login Dialog kommt, Passwort eingeben, Login Dialog verschwindet, nichts passiert.


    Nun den, hier einmal das ganze Codetechische:
    Logindialog bei OnDialogResponse:

    Spoiler anzeigen

    else if(dialogid == DIALOG_LOGIN)
    {
    if(response == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "*** Du hast den Vorgang abgebrochen und wurdest automatisch gekickt.");
    TogglePlayerControllable(playerid, 0);
    Kick(playerid);
    }
    if(response == 1)
    {
    if(strlen(inputtext) == 0 || strlen(inputtext) < -1 || strlen(inputtext) > 15) // Wenn kein Passwort angegebene wurde
    {
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""#SERVERNAME": Login", "{FFFFFF}Bitte logge dich ein indem du dein Passwort unten eingibst.","Login","Abbruch");
    return 1;
    }
    else
    {
    new NotJoin = 0;
    new StepID = -1;
    new sendername[MAX_PLAYER_NAME];
    for(new i = 0; i < sizeof(OffPickup); i++)
    {
    if(OffPickup[i][OffErstellt] == 1)
    {
    if(OffPickup[i][OffZeit] > 0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));

    Spoiler anzeigen
    if(strcmp(sendername,OffPickup[i][OfflineName], true) == 0)
    {
    NotJoin = 1;
    StepID = i;
    break;
    }
    }
    }
    }
    if(CheckPasswort(playerid, inputtext) == 1) // Wir holen uns das Passwort aus der MySQL Datenbank und überprüfen es mit dem angegebenen passwort.
    {
    if(NotJoin == 1)
    {
    format(string, sizeof(string), "{FFFFFF}Du musst warten bis dein Logout Pickup weg ist. "#SERVERFARBE"(%d Sekunden)", OffPickup[StepID][OffZeit]);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""#SERVERNAME": Login", string,"Login","Abbruch");
    return 1;
    }
    strmid(PlayerInfo[playerid][pKey], inputtext, 0, strlen(inputtext), 255);
    OnPlayerLogin(playerid); //Der Spieler wird "geladen", speich es werden seine Daten aus der Datenbank geholt und in variablen gespeichert um diese im Skript zu verwenden.
    return 1;
    }
    else
    {
    //Wenn das Passwort falsch war, lassen wir erneut das Login fenster erscheinen damit der Spieler das Richtige Passwort eingibt.
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""#SERVERNAME": Login", "{FFFFFF}Das eingegebene Passwort ist falsch, bitte versuche es erneut.","Login","Abbruch");
    return 1;
    }
    }
    }
    return 1;
    }


    Register Dialog bei OnDialogResponse:
    Spoiler anzeigen

    else if(dialogid == DIALOG_REGISTER)
    {
    if(response == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "*** Du hast den Vorgang abgebrochen und wurdest automatisch gekickt.");
    TogglePlayerControllable(playerid, 0);
    Kick(playerid);
    }
    if(response == 1)
    {
    if(!strlen(inputtext) || strlen(inputtext) < -1 || strlen(inputtext) > 15 || strlen(inputtext) < 6)
    {
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""#SERVERNAME": Registrieren", "{FFFFFF}Dein Passwort muss mindestens 6 und maximal 15 Bustaben haben\nUnd darf nur auch Bustaben von A-Z und Zahlen von 0-9 Bestehen.", "Registrieren", "Abbruch");
    return 1;
    }
    new ForbiddenCharactersExist = 0;
    for(new ac = 0; ac < sizeof(ForbiddenCharacters); ac++)
    {
    if(strfind(inputtext, ForbiddenCharacters[ac], true) != -1)
    {
    ForbiddenCharactersExist = 1;
    break;
    }
    }
    if(strlen(inputtext) > 15 || ForbiddenCharactersExist == 1)
    {
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""#SERVERNAME": Registrieren", "{FFFFFF}Dein Passwort muss mindestens 6 und maximal 15 Bustaben haben\nUnd darf nur auch Bustaben von A-Z und Zahlen von 0-9 Bestehen.", "Registrieren", "Abbruch");
    return SendClientMessage(playerid, COLOR_LIGHTRED, "*** Dein Passwort darf maximal 10 Zeichen haben und darf nur aus A-Z bzw. a-z und 1-9 inkl. 0 bestehen !");
    }
    new tmppass[64];
    strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
    //Encrypt(tmppass);
    OnPlayerRegister(playerid, tmppass);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""#SERVERNAME": Login", "{FFFFFF}Bitte logge dich ein indem du dein Passwort unten eingibst.", "Login", "Abbruch");
    }
    return 1;
    }


    OnPlayerLogin:
    Spoiler anzeigen


    public OnPlayerLogin(playerid)
    {
    RemoveBuildings(playerid);
    new string[450],
    sendername[MAX_PLAYER_NAME];
    new Beschwerden = 0;
    //new LoginChecker;
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "UPDATE `server_accounts` SET `Online` = '1' WHERE Name = '%s'", sendername);
    self_mysql_query(string);
    getdate(Jahr, Monat, Tag);
    gettime(Stunde, Minute, Sekunde);
    GetPlayerName(playerid, sendername, sizeof(sendername)); //Wir Speichern den Namen des Spielers in der Variable [i]SpielerInfo[playerid][pName][/i]
    print("Test 1");
    if(IsPlayerConnected(playerid))//Wir fragen ab ob der angegebene Spieler auch Online ist, und kein NPC ist (nur zur sicherhheit)
    {
    format(string, sizeof(string),"SELECT * FROM `server_accounts` WHERE `Name` = '%s'", sendername);
    mysql_query(string);//wir holen uns alles aus der tabelle "tabelle_mit_den_haeusern"
    mysql_store_result();//speichern dann das ergebniss
    print("Test 2");
    new val[ 256 ];
    while(mysql_fetch_row_format(string,"|"))
    {
    self_mysql_get_field("Level", val); PlayerInfo[playerid][pLevel] = strval( val );
    self_mysql_get_field("AdminLevel", val); PlayerInfo[playerid][pAdmin] = strval( val );
    self_mysql_get_field("DonateRank", val); PlayerInfo[playerid][pDonatorRank] = strval( val );
    self_mysql_get_field("UpgradePoints", val); PlayerInfo[playerid][gPupgrade] = strval( val );
    self_mysql_get_field("ConnectedTime", val); PlayerInfo[playerid][pConnectTime] = strval( val );
    self_mysql_get_field("Registered", val); PlayerInfo[playerid][pReg] = strval( val );
    self_mysql_get_field("Sex", val); PlayerInfo[playerid][pSex] = strval( val );
    self_mysql_get_field("Age", val); PlayerInfo[playerid][pAlter] = strval( val );
    self_mysql_get_field("Origin", val); PlayerInfo[playerid][pOrigin] = strval( val );
    self_mysql_get_field("Muted", val); PlayerInfo[playerid][pMuted] = strval( val );
    self_mysql_get_field("Respect", val); PlayerInfo[playerid][pRespekt] = strval( val );
    self_mysql_get_field("Money", val); PlayerInfo[playerid][pCash] = strval( val );
    self_mysql_get_field("Bank", val); PlayerInfo[playerid][pBank] = strval( val );
    self_mysql_get_field("ShopCoins", val); PlayerInfo[playerid][pShopCoins] = strval( val );
    self_mysql_get_field("Allowed", val); PlayerInfo[playerid][pAllowed] = strval( val );
    self_mysql_get_field("bankfach1", val); PlayerInfo[playerid][pBankFach1] = strval( val );
    self_mysql_get_field("bankfach2", val); PlayerInfo[playerid][pBankFach2] = strval( val );
    self_mysql_get_field("bankfach3", val); PlayerInfo[playerid][pBankFach3] = strval( val );
    self_mysql_get_field("bankfach4", val); PlayerInfo[playerid][pBankFach4] = strval( val );
    self_mysql_get_field("wgs", val); PlayerInfo[playerid][pwgs] = strval( val );
    self_mysql_get_field("facherlaubis", val); PlayerInfo[playerid][pfacherlaubis] = strval( val );
    self_mysql_get_field("Crimes", val); PlayerInfo[playerid][pCrimes] = strval( val );
    self_mysql_get_field("Kills", val); PlayerInfo[playerid][pKills] = strval( val );
    self_mysql_get_field("sKills", val); PlayerInfo[playerid][psKills] = strval( val );
    self_mysql_get_field("Deaths", val); PlayerInfo[playerid][pDeaths] = strval( val );
    self_mysql_get_field("Arrested", val); PlayerInfo[playerid][pArrested] = strval( val );
    self_mysql_get_field("ArrestTime", val); PlayerInfo[playerid][pArrestTime] = strval( val );
    self_mysql_get_field("PhoneBook", val); PlayerInfo[playerid][pPhoneBook] = strval( val );
    self_mysql_get_field("LottoNr", val); PlayerInfo[playerid][pLottoNr] = strval( val );
    self_mysql_get_field("Fishes", val); PlayerInfo[playerid][pFishes] = strval( val );
    self_mysql_get_field("BiggestFish", val); PlayerInfo[playerid][pBiggestFish] = strval( val );
    self_mysql_get_field("Job", val); PlayerInfo[playerid][pJob] = strval( val );
    self_mysql_get_field("Paycheck", val); PlayerInfo[playerid][pPayCheck] = strval( val );
    self_mysql_get_field("HeadValue", val); PlayerInfo[playerid][pHeadValue] = strval( val );
    self_mysql_get_field("Jailed", val); PlayerInfo[playerid][pJailed] = strval( val );
    self_mysql_get_field("JailTime", val); PlayerInfo[playerid][pJailTime] = strval( val );
    self_mysql_get_field("MehrZinsen", val); PlayerInfo[playerid][pMehrZinsen] = strval( val );
    self_mysql_get_field("Waffenspawn", val); PlayerInfo[playerid][pWaffenspawn] = strval( val );
    self_mysql_get_field("Leader", val); PlayerInfo[playerid][pLeader] = strval( val );
    self_mysql_get_field("Member", val); PlayerInfo[playerid][pMember] = strval( val );
    self_mysql_get_field("Rank", val); PlayerInfo[playerid][pRank] = strval( val );
    self_mysql_get_field("Skin", val); PlayerInfo[playerid][pChar] = strval( val );
    self_mysql_get_field("Vertragszeit", val); PlayerInfo[playerid][pVertragszeit] = strval( val );
    self_mysql_get_field("DetSkill", val); PlayerInfo[playerid][pDetSkill] = strval( val );
    self_mysql_get_field("SexSkill", val); PlayerInfo[playerid][pSexSkill] = strval( val );
    self_mysql_get_field("LawSkill", val); PlayerInfo[playerid][pAnwaltSkill] = strval( val );
    self_mysql_get_field("MechSkill", val); PlayerInfo[playerid][pMechSkill] = strval( val );
    self_mysql_get_field("JackSkill", val); PlayerInfo[playerid][pJackSkill] = strval( val );
    self_mysql_get_field("CarSkill", val); PlayerInfo[playerid][pCarSkill] = strval( val );
    self_mysql_get_field("NewsSkill", val); PlayerInfo[playerid][pNewsSkill] = strval( val );
    self_mysql_get_field("DrugsSkill", val); PlayerInfo[playerid][pDrugsSkill] = strval( val );
    self_mysql_get_field("CookSkill", val); PlayerInfo[playerid][pCookSkill] = strval( val );
    self_mysql_get_field("FishSkill", val); PlayerInfo[playerid][pFishSkill] = strval( val );
    self_mysql_get_field("pSHealth", val); PlayerInfo[playerid][pSHealth] = floatstr( val );
    self_mysql_get_field("PhoneNr", val); PlayerInfo[playerid][pNummer] = strval( val );
    self_mysql_get_field("House", val); PlayerInfo[playerid][pPhousekey] = strval( val );
    self_mysql_get_field("Biz", val); PlayerInfo[playerid][pBizKey] = strval( val );
    self_mysql_get_field("Hotel",val); PlayerInfo[playerid][pPhotelkey] = strval( val );
    self_mysql_get_field("CarLic", val); PlayerInfo[playerid][pCarLic] = strval( val );
    self_mysql_get_field("FlyLic", val); PlayerInfo[playerid][pFlyLic] = strval( val );
    self_mysql_get_field("BoatLic", val); PlayerInfo[playerid][pBoatLic] = strval( val );
    self_mysql_get_field("FishLic", val); PlayerInfo[playerid][pFishLic] = strval( val );
    self_mysql_get_field("GunLic", val); PlayerInfo[playerid][pGunLic] = strval( val );
    self_mysql_get_field("Zollpass", val); PlayerInfo[playerid][pZollpass] = strval( val );
    self_mysql_get_field("Gun1", val); PlayerInfo[playerid][pGun1] = strval( val );
    self_mysql_get_field("Gun2", val); PlayerInfo[playerid][pGun2] = strval( val );
    self_mysql_get_field("Gun3", val); PlayerInfo[playerid][pGun3] = strval( val );
    self_mysql_get_field("Gun4", val); PlayerInfo[playerid][pGun4] = strval( val );
    self_mysql_get_field("Ammo1", val); PlayerInfo[playerid][pAmmo1] = strval( val );
    self_mysql_get_field("Ammo2", val); PlayerInfo[playerid][pAmmo2] = strval( val );
    self_mysql_get_field("Ammo3", val); PlayerInfo[playerid][pAmmo3] = strval( val );
    self_mysql_get_field("Ammo4", val); PlayerInfo[playerid][pAmmo4] = strval( val );
    self_mysql_get_field("CarTime", val); PlayerInfo[playerid][pCarTime] = strval( val );
    self_mysql_get_field("PayDay", val); PlayerInfo[playerid][pPayDay] = strval( val );
    self_mysql_get_field("PayDayHad", val); PlayerInfo[playerid][pPayDayHad] = strval( val );
    self_mysql_get_field("CDPlayer", val); PlayerInfo[playerid][pCDPlayer] = strval( val );
    self_mysql_get_field("AlcoholPerk", val); PlayerInfo[playerid][pAlcoholPerk] = strval( val );
    self_mysql_get_field("DrugPerk", val); PlayerInfo[playerid][pDrugPerk] = strval( val );
    self_mysql_get_field("MiserPerk", val); PlayerInfo[playerid][pMiserPerk] = strval( val );
    self_mysql_get_field("TraderPerk", val); PlayerInfo[playerid][pTraderPerk] = strval( val );
    self_mysql_get_field("PainKillerPerk", val); PlayerInfo[playerid][pPainKillerPerk] = strval( val );
    self_mysql_get_field("Tutorial", val); PlayerInfo[playerid][pTut] = strval( val );
    self_mysql_get_field("Warnings", val); PlayerInfo[playerid][pWarns] = strval( val );
    self_mysql_get_field("Fuel", val); PlayerInfo[playerid][pFuel] = strval( val );
    self_mysql_get_field("Married", val); PlayerInfo[playerid][pMarried] = strval( val );
    self_mysql_get_field("MarriedTo", val); strmid(PlayerInfo[playerid][pMarriedTo], val, 0, strlen(val), 255);
    self_mysql_get_field("WantedLevel", val); PlayerInfo[playerid][pWantedLevel] = strval( val );
    self_mysql_get_field("Spawn", val); PlayerInfo[playerid][pSpawn] = strval( val );
    self_mysql_get_field("SavedMaterials", val); PlayerInfo[playerid][pSaveMats] = strval( val );
    self_mysql_get_field("SavedDrugs", val); PlayerInfo[playerid][pSaveDrugs] = strval( val );
    self_mysql_get_field("SavedDrugsCrystal", val); PlayerInfo[playerid][pSaveDrugsCrystal] = strval( val );
    self_mysql_get_field("SavedDrugsExtasy", val); PlayerInfo[playerid][pSaveDrugsExtasy] = strval( val );
    self_mysql_get_field("SavedDrugsKokain", val); PlayerInfo[playerid][pSaveDrugsKokain] = strval( val );
    self_mysql_get_field("SavedDrugsSpeed", val); PlayerInfo[playerid][pSaveDrugsSpeed] = strval( val );
    self_mysql_get_field("SavedDrugsLSD", val); PlayerInfo[playerid][pSaveDrugsLSD] = strval( val );
    self_mysql_get_field("DrugsCrystal", val); PlayerInfo[playerid][pDrugsCrystal] = strval( val );
    self_mysql_get_field("DrugsExtasy", val); PlayerInfo[playerid][pDrugsExtasy] = strval( val );
    self_mysql_get_field("DrugsKokain", val); PlayerInfo[playerid][pDrugsKokain] = strval( val );
    self_mysql_get_field("DrugsSpeed", val); PlayerInfo[playerid][pDrugsSpeed] = strval( val );
    self_mysql_get_field("DrugsLSD", val); PlayerInfo[playerid][pDrugsLSD] = strval( val );
    self_mysql_get_field("Piperonal", val); PlayerInfo[playerid][pPiperonal] = strval( val );
    self_mysql_get_field("Safrol", val); PlayerInfo[playerid][pSafrol] = strval( val );
    self_mysql_get_field("Phenylaceton", val); PlayerInfo[playerid][pPhenylaceton] = strval( val );
    self_mysql_get_field("Lithium", val); PlayerInfo[playerid][pLithium] = strval( val );
    self_mysql_get_field("Norephedrin", val); PlayerInfo[playerid][pNorephedrin] = strval( val );
    self_mysql_get_field("Epehdrin", val); PlayerInfo[playerid][pEpehdrin] = strval( val );
    self_mysql_get_field("Ergotamin", val); PlayerInfo[playerid][pErgotamin] = strval( val );
    self_mysql_get_field("Natronlauge", val); PlayerInfo[playerid][pNatronlauge] = strval( val );
    self_mysql_get_field("VMethylimin", val); PlayerInfo[playerid][pVMethylimin] = strval( val );
    self_mysql_get_field("Alluminium", val); PlayerInfo[playerid][pAlluminium] = strval( val );
    self_mysql_get_field("Lysin", val); PlayerInfo[playerid][pLysin] = strval( val );
    self_mysql_get_field("Ammoniak", val); PlayerInfo[playerid][pAmmoniak] = strval( val );
    self_mysql_get_field("Hydroclorid", val); PlayerInfo[playerid][pHydroclorid] = strval( val );
    self_mysql_get_field("Staerke", val); PlayerInfo[playerid][pStaerke] = strval( val );
    self_mysql_get_field("Cocapflanzen", val); PlayerInfo[playerid][pCocapflanzen] = strval( val );
    self_mysql_get_field("SaveCodes", val); PlayerInfo[playerid][pSaveCodes] = strval( val );
    self_mysql_get_field("BikeLic", val); PlayerInfo[playerid][pBikeLic] = strval( val );
    self_mysql_get_field("LKWLic", val); PlayerInfo[playerid][pLKWLic] = strval( val );
    self_mysql_get_field("DonatorTime", val); PlayerInfo[playerid][pDonatorZeit] = strval( val );
    self_mysql_get_field("WerberName", val); strmid(PlayerInfo[playerid][pWerberName], val, 0, strlen(val), 255);
    self_mysql_get_field("FightingStyle", val); PlayerInfo[playerid][pFightingStyle] = strval( val );
    self_mysql_get_field("Handy", val); PlayerInfo[playerid][pHandy] = strval( val );
    self_mysql_get_field("OnDutySkin", val); PlayerInfo[playerid][pOnDutySkin] = strval( val );
    self_mysql_get_field("CarLicPoints", val); PlayerInfo[playerid][pCarLicPoints] = strval( val );
    self_mysql_get_field("BikeLicPoints", val); PlayerInfo[playerid][pBikeLicPoints] = strval( val );
    self_mysql_get_field("InviteSperre", val); PlayerInfo[playerid][pInviteSperre] = strval( val );
    self_mysql_get_field("warntime1", val); PlayerInfo[playerid][pWarnTime1] = strval( val );
    self_mysql_get_field("warntime2", val); PlayerInfo[playerid][pWarnTime2] = strval( val );
    self_mysql_get_field("Ticketsopen", val); PlayerInfo[playerid][pTicketsopen] = strval( val );
    self_mysql_get_field("OldName", val); strmid(PlayerInfo[playerid][pOldName], val, 0, strlen(val), 255);
    self_mysql_get_field("OrgMember", val); PlayerInfo[playerid][pOrgaID] = strval( val );
    self_mysql_get_field("OrgLeader", val); PlayerInfo[playerid][pOrgaLeader] = strval( val );
    self_mysql_get_field("OrgName", val); strmid(PlayerInfo[playerid][pOrgaName], val, 0, strlen(val), 255);
    self_mysql_get_field("SQLid", val); PlayerInfo[playerid][pSQLID] = strval( val );
    self_mysql_get_field("OPBeschwerden", val); Beschwerden = strval( val );
    mysql_free_result();
    print("Test 3");
    }

    Spoiler anzeigen
    }
    if(PlayerInfo[playerid][pAdmin] > 2000 && PlayerInfo[playerid][pSQLID] != 1)
    {
    format(string, sizeof(string), "UPDATE `server_accounts` SET `AdminLevel`='0' WHERE `Name`='%s'", sendername);
    self_mysql_query(string);
    SendClientMessage(playerid, COLOR_KNALLROT, "\tBeim Laden deines Account's ist ein Fehler aufgetreten,");
    SendClientMessage(playerid, COLOR_KNALLROT, "\tBitte wende dich an einem Admin.");
    Kick(playerid);
    return 1;
    }
    print("Test 4");
    new DeleteDate, Days;
    Days = (62*24*60*60)+(PlayerInfo[playerid][pLevel]*24*60*60);
    DeleteDate = Days+Time();
    format(string, sizeof(string), "UPDATE `server_accounts` SET `DeleteDatum`='%d', `LastLoginDatum`='%d' WHERE `Name`='%s'", DeleteDate, Time(), sendername);
    self_mysql_query(string);
    ResetPlayerWeapon(playerid);
    print("Test 5");
    if(PlayerInfo[playerid][pDonatorRank] == 2)
    {
    if(PlayerInfo[playerid][pDonatorZeit] < 10)
    {
    PlayerInfo[playerid][pDonatorRank] = 1;
    }
    }
    print("Test 6");
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    if(PlayerInfo[playerid][pMarried] == 0)
    {
    ClearMarriage(playerid);
    }
    print("Test 7");
    if(PlayerInfo[playerid][pOrigin] == 0) { PlayerInfo[playerid][pOrigin] = 1; }
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pReg] = 1;
    PlayerInfo[playerid][pAlter] = 0;
    PlayerInfo[playerid][pTut] = 1;
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 50.0;
    StuffInfo[sLastNumber] += 1;
    PlayerInfo[playerid][pNummer] = StuffInfo[sLastNumber];
    PlayerInfo[playerid][pPhousekey] = -1;
    PlayerInfo[playerid][pBizKey] = -1;
    PlayerInfo[playerid][pBank] = 40000;
    GivePlayerMoneys(playerid, 10000);
    StuffInfo[sSteuerkasse] -= 50000;
    PlayerInfo[playerid][pChar] = 101;
    PlayerInfo[playerid][pCrimes] = 0;
    PlayerInfo[playerid][pArrested] = 0;
    PlayerInfo[playerid][pArrestTime] = 0;
    PlayerInfo[playerid][pKills] = 0;
    PlayerInfo[playerid][psKills] = 0;
    PlayerInfo[playerid][pDeaths] = 0;
    PlayerInfo[playerid][pMember] = -1;
    PlayerInfo[playerid][pLeader] = -1;
    PlayerInfo[playerid][pOnDutySkin] = 60;
    /*Scheine*/
    PlayerInfo[playerid][pGunLic] = 0;
    PlayerInfo[playerid][pFlyLic] = 0;
    PlayerInfo[playerid][pCarLic] = 0;
    PlayerInfo[playerid][pBikeLic] = 0;
    /*Scheine Ende*/
    }
    print("Test 8");
    if(PlayerInfo[playerid][pLeader] != -1)
    {
    PlayerInfo[playerid][pTeam] = PlayerInfo[playerid][pLeader];
    }
    else if(PlayerInfo[playerid][pMember] != -1)
    {
    PlayerInfo[playerid][pTeam] = PlayerInfo[playerid][pMember];
    }
    print("Test 10");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    SendClientMessage(playerid, COLOR_GREY," ");
    format(string, sizeof(string), "*** Willkommen %s",sendername);
    SendClientMessage(playerid, COLOR_WHITE, string);
    print("Test 11");
    if(PlayerInfo[playerid][pDonatorRank] > 0)
    {
    SendClientMessage(playerid, COLOR_WHITE,"*** Du hast einen Premium/Donator Account, danke das du unseren Server unterstützt.");
    if(PlayerInfo[playerid][pDonatorRank] == 2)
    {

    Spoiler anzeigen
    }
    }
    print("Test 12");
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string, sizeof(string), ""#SERVERFARBE"*** Du hast dich als Admin eingeloggt. Rang: %s", Adminrang(PlayerInfo[playerid][pAdmin]));
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    print("Test 13");
    format(string, sizeof(string), " %s [ID: %d] hat den Server betreten.",sendername, playerid);
    ForAllPlayers(i){
    if(IsPlayerConnected(i)){
    if(TogLoginLogout[i] == 0){
    SendClientMessage(i, COLOR_LIGHTGREEN, string); //Connect message
    }}}
    print("Test 14");
    if(PlayerInfo[playerid][pChar] != -1)
    {
    new UseSkin = PlayerInfo[playerid][pChar];
    SetSpawnInfo(playerid, 0, UseSkin,0.0,0.0,0.0,0,0,0,0,0,0,0);
    }
    print("Test 15");
    TextDrawShowForPlayer(playerid, Text:UhrzeitStundeMinute);
    TextDrawShowForPlayer(playerid, Text:DatumTagMonat);
    TextDrawHideForPlayer(playerid, Text:NODMZoneTextdraw);
    MedicBill[playerid] = 0;
    FirstSpawnAfterLogin[playerid] = 1;
    DateProp(playerid);
    SendClientMessage(playerid, COLOR_WHITE, "Du hast dich erfolgreich eingeloggt!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    Logintime[playerid] = 1;
    gPlayerLogged[playerid] = 1;
    StuffInfo[sLoggins] += 1;
    self_mysql_query(string);
    PlayerCarConnect(playerid);
    print("Test 16");
    if(PlayerInfo[playerid][pWarns] > 0)
    {
    format(string, sizeof(string), "Achtung: Du hast schon %d von 3 Verwarnungen. Bei 3 Verwarnungen wirst du gebannt.", PlayerInfo[playerid][pWarns]);
    SendClientMessage(playerid, COLOR_RED, string);
    }
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
    strmid(PlayerInfo[playerid][pForceName], "Niemand", 0, strlen("Niemand"), 255);
    CheckTime(playerid);
    PlayerPlaySound(playerid, 1098, 0.0, 0.0, 0.0);
    print("Test 17");
    if(PlayerInfo[playerid][pTut] == 1)
    {
    SpawnPlayer(playerid);
    }
    print("Test 18");
    if(Beschwerden >= 1)
    {
    format(string, sizeof(string), "Du hast %d ungelesende Beschwerden.", Beschwerden);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    }
    SetPVarInt(playerid, "PVTeam", PlayerInfo[playerid][pTeam]);
    SetPVarInt(playerid, "PVAdmin", PlayerInfo[playerid][pAdmin]);
    SetPVarInt(playerid, "PVJob", PlayerInfo[playerid][pJob]);
    LoadUberweisungen(playerid);
    print("Test 19");
    return 1;
    }
    //Prints waren nur für Testzwecke

    OnPlayerRegister:
    Spoiler anzeigen


    public OnPlayerRegister(playerid, password[])
    {
    StuffInfo[sNeuUser] += 1;
    if(IsPlayerConnected(playerid))
    {
    new string[128],
    playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "%s", password);
    strmid(PlayerInfo[playerid][pKey], string, 0, strlen(string), 255);
    format(string, sizeof(string), "INSERT INTO `server_accounts` (`Name`, `Password`) VALUES ('%s', '%s')", playername, PlayerInfo[playerid][pKey]);
    self_mysql_query(string);
    format(string, sizeof(string), "UPDATE `server_accounts` SET `RegisterDatum`='%d' WHERE `Name`='%s'", Time(), playername);
    self_mysql_query(string);
    PlayerUpdate(playerid);
    }
    return 1;
    }


    Ich hoffe, ihr könnt mir helfen.


    Mit freundlichen Grüßen,
    Voxa