Benötige Hilfe bei MySQL

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
  • Hi,
    ich habe mein GF Edit in MySQL umgebastelt. >> Keine Fehler - Nicht's!
    Gut, wenn ich nun auf den Server joine und mich registriere funktioniert noch alles wunderbar, [ Nanu :D ]
    allerdings, wenn ich den Server verlasse und anschließend erneut joine und mich einlogge, bevor ich noch Spawn drücken kann... >> Server closed the Connection.


    Ich würde mich freuen, falls mir jemand über Teamviewer helfen könnte, der etwas davon versteht!


    MfG K4biX

  • SpawnPlayer ohne SetSpawnInfo benutzt?

    Nur wenn man das Unmögliche versucht kann man das absolut Mögliche erreichen
    Hermann Hesse


    „Was manche Menschen sich selber vormachen, das macht ihnen so schnell keiner nach.”
    Gerhard Uhlenbruck

  • Poste mal den Teil im Script wo es passiert.
    Also anscheinend nach deiner Beschreibun da, wo der Spieler angemeldet/geladen wird

    Nur wenn man das Unmögliche versucht kann man das absolut Mögliche erreichen
    Hermann Hesse


    „Was manche Menschen sich selber vormachen, das macht ihnen so schnell keiner nach.”
    Gerhard Uhlenbruck

  • So wird der Spieler geladen.


    stock LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))//Wir fragen ab ob der angegebene Spieler auch Online ist, und kein NPC ist (nur zur sicherhheit)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    PlayerInfo[playerid][pLevel] = mysql_GetInt("samp_accountsi", "PlayerLevel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCash] = mysql_GetInt("samp_accountsi", "Money", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAccount] = mysql_GetInt("samp_accountsi", "Bank", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKills] = mysql_GetInt("samp_accountsi", "Kills", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDeaths] = mysql_GetInt("samp_accountsi", "Deaths", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAdmin] = mysql_GetInt("samp_accountsi", "AdminLevel", "Name", PlayerInfo[playerid][pName]);
    //PlayerInfo[playerid][pHealth] = mysql_GetFloat("samp_accountsi", "pHealth", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDonateRank] = mysql_GetInt("samp_accountsi", "DonateRank", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][gPupgrade] = mysql_GetInt("samp_accountsi", "UpgradePoints", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pExp] = mysql_GetInt("samp_accountsi", "Respect", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pConnectTime] = mysql_GetInt("samp_accountsi", "ConnectedTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pReg] = mysql_GetInt("samp_accountsi", "Registered", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSex] = mysql_GetInt("samp_accountsi", "Sex", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAge] = mysql_GetInt("samp_accountsi", "Age", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pOrigin] = mysql_GetInt("samp_accountsi", "Origin", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCK] = mysql_GetInt("samp_accountsi", "CK", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMuted] = mysql_GetInt("samp_accountsi", "Muted", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCrimes] = mysql_GetInt("samp_accountsi", "Crimes", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pArrested] = mysql_GetInt("samp_accountsi", "Arrested", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pWantedDeaths] = mysql_GetInt("samp_accountsi", "WantedDeaths", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPhoneBook] = mysql_GetInt("samp_accountsi", "Phonebook", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPnumber] = mysql_GetInt("samp_accountsi", "PhoneNr", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLottoNr] = mysql_GetInt("samp_accountsi", "LottoNr", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFishes] = mysql_GetInt("samp_accountsi", "Fishes", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pBiggestFish] = mysql_GetInt("samp_accountsi", "BiggestFish", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJob] = mysql_GetInt("samp_accountsi", "Job", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPayCheck] = mysql_GetInt("samp_accountsi", "Paycheck", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pHeadValue] = mysql_GetInt("samp_accountsi", "HeadValue", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJailed] = mysql_GetInt("samp_accountsi", "Jailed", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJailTime] = mysql_GetInt("samp_accountsi", "JailTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMats] = mysql_GetInt("samp_accountsi", "Materials", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrugs] = mysql_GetInt("samp_accountsi", "Drugs", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSnacks] = mysql_GetInt("samp_accountsi", "Snacks", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrinks] = mysql_GetInt("samp_accountsi", "Drinks", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKondome] = mysql_GetInt("samp_accountsi", "Kondome", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLeader] = mysql_GetInt("samp_accountsi", "Leader", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMember] = mysql_GetInt("samp_accountsi", "Member", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pRank] = mysql_GetInt("samp_accountsi", "Rank", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pChar] = mysql_GetInt("samp_accountsi", "Skin", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pContractTime] = mysql_GetInt("samp_accountsi", "ContractTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDetSkill] = mysql_GetInt("samp_accountsi", "DetSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSexSkill] = mysql_GetInt("samp_accountsi", "SexSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pBoxSkill] = mysql_GetInt("samp_accountsi", "BoxSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLawSkill] = mysql_GetInt("samp_accountsi", "LawSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMechSkill] = mysql_GetInt("samp_accountsi", "MechSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pJackSkill] = mysql_GetInt("samp_accountsi", "JackSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCarSkill] = mysql_GetInt("samp_accountsi", "CarSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pNewsSkill] = mysql_GetInt("samp_accountsi", "NewsSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrugsSkill] = mysql_GetInt("samp_accountsi", "DrugsSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCookSkill] = mysql_GetInt("samp_accountsi", "CookSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFishSkill] = mysql_GetInt("samp_accountsi", "FishSkill", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSHealth] = mysql_GetFloat("samp_accountsi", "pSHealth", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pInt] = mysql_GetInt("samp_accountsi", "Inte", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLocal] = mysql_GetInt("samp_accountsi", "Local", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTeam] = mysql_GetInt("samp_accountsi", "Team", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pModel] = mysql_GetInt("samp_accountsi", "Model", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGPS] = mysql_GetInt("samp_accountsi", "pGps", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAngel] = mysql_GetInt("samp_accountsi", "pAngel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg1] = mysql_GetInt("samp_accountsi", "Erfolg1", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg2] = mysql_GetInt("samp_accountsi", "Erfolg2", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg3] = mysql_GetInt("samp_accountsi", "Erfolg3", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pErfolg4] = mysql_GetInt("samp_accountsi", "Erfolg4", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPhousekey] = mysql_GetInt("samp_accountsi", "House", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPbiskey] = mysql_GetInt("samp_accountsi", "Bizz", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_x] = mysql_GetFloat("samp_accountsi", "Pos_x", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_y] = mysql_GetFloat("samp_accountsi", "Pos_y", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_z] = mysql_GetFloat("samp_accountsi", "Pos_z", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pOwnPerso] = mysql_GetInt("samp_accountsi", "pPersonalausweiß", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCarLic] = mysql_GetInt("samp_accountsi", "CarLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pNewLic] = mysql_GetInt("samp_accountsi", "NewLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFlyLic] = mysql_GetInt("samp_accountsi", "FlyLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pBoatLic] = mysql_GetInt("samp_accountsi", "BoatLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFishLic] = mysql_GetInt("samp_accountsi", "FishLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGunLic] = mysql_GetInt("samp_accountsi", "GunLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLKWLic] = mysql_GetInt("samp_accountsi", "LkwLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMotoLic] = mysql_GetInt("samp_accountsi", "MotoLic", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun1] = mysql_GetInt("samp_accountsi", "Gun1", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun2] = mysql_GetInt("samp_accountsi", "Gun2", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun3] = mysql_GetInt("samp_accountsi", "Gun3", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGun4] = mysql_GetInt("samp_accountsi", "Gun4", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo1] = mysql_GetInt("samp_accountsi", "Ammo1", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo2] = mysql_GetInt("samp_accountsi", "Ammo2", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo3] = mysql_GetInt("samp_accountsi", "Ammo3", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAmmo4] = mysql_GetInt("samp_accountsi", "Ammo4", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCarTime] = mysql_GetInt("samp_accountsi", "CarTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPayDay] = mysql_GetInt("samp_accountsi", "PayDay", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPayDayHad] = mysql_GetInt("samp_accountsi", "PayDayHad", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pCDPlayer] = mysql_GetInt("samp_accountsi", "CDplayer", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pWins] = mysql_GetInt("samp_accountsi", "Wins", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLoses] = mysql_GetInt("samp_accountsi", "Loses", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAlcoholPerk] = mysql_GetInt("samp_accountsi", "AlcoholPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pDrugPerk] = mysql_GetInt("samp_accountsi", "DrugPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMiserPerk] = mysql_GetInt("samp_accountsi", "MiserPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPainPerk] = mysql_GetInt("samp_accountsi", "PainPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTraderPerk] = mysql_GetInt("samp_accountsi", "TraderPerk", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTut] = mysql_GetInt("samp_accountsi", "Tutorial", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMissionNr] = mysql_GetInt("samp_accountsi", "Mission", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pWarns] = mysql_GetInt("samp_accountsi", "Warnings", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pFuel] = mysql_GetInt("samp_accountsi", "Fuel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTankerTime] = mysql_GetInt("samp_accountsi", "TankerTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMarried] = mysql_GetInt("samp_accountsi", "Married", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMarriedTo] = mysql_GetInt("samp_accountsi", "MarriedTo", "Name", PlayerInfo[playerid][pName]);
    //PlayerInfo[playerid][pLastOnline] = mysql_GetInt("samp_accountsi", "user_lastonline", "Name", PlayerInfo[playerid][pName]);
    }
    return 1;
    }


    Login Dialog:


    if(dialogid == DIALOG_LOGIN)
    {
    if(response)
    {
    if(strlen(inputtext) == 0) //Wenn kein Passwort angegebene wurde
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das angegebene Passwort war ungültig.\nBitte log dich jetzt mit deinem richtigen Passwort ein:","Bestätigen","Abbrechen");
    return 1;
    }
    else
    {
    new SpielerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, SpielerName, MAX_PLAYER_NAME);
    if(!strcmp(inputtext, mysql_ReturnPasswort(SpielerName), true)) // Wir holen uns das Passwort aus der MySQL Datenbank und überprüfen es mit dem angegebenen passwort.
    {
    LoadPlayer(playerid); //Der Spieler wird "geladen", sprich es werden seine Daten aus der Datenbank geholt und in variablen gespeichert um diese im Skript zu verwenden.
    ResetPlayerMoney(playerid);
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 0.0;
    PlayerInfo[playerid][pHealth] = 50.0;
    PlayerInfo[playerid][pPos_x] = 2246.6;
    PlayerInfo[playerid][pPos_y] = -1161.9;
    PlayerInfo[playerid][pPos_z] = 1029.7;
    PlayerInfo[playerid][pInt] = 15;
    PlayerInfo[playerid][pLocal] = 255;
    PlayerInfo[playerid][pTeam] = 3;
    new rand = random(sizeof(CIV));
    PlayerInfo[playerid][pModel] = CIV[rand];
    new randphone = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerInfo[playerid][pPhousekey] = 255;
    PlayerInfo[playerid][pPbiskey] = 255;
    PlayerInfo[playerid][pAccount] = 30000;
    PlayerInfo[playerid][pReg] = 1;
    }
    if(PlayerInfo[playerid][pLevel] == -999) //autoban
    {
    format(string,sizeof(string),"AdmCmd: %s versuchte sicht mit seinem gebannten Account einzuloggen und wurde gekickt.",SpielerName);
    SendAdminMessage(COLOR_LIGHTRED,string,1);
    SendClientMessage(playerid,COLOR_LIGHTRED,"Dein Account ist gebannt!");
    Ban(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pCK] > 0)
    {
    Kick(playerid);
    }
    printf("%s has logged in.",SpielerName);
    SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
    if(gTeam[playerid] == 0)
    {
    gTeam[playerid] = 3;
    }
    else
    {
    gTeam[playerid] = PlayerInfo[playerid][pTeam];
    }
    new tmp2[64];
    gPlayerLogged[playerid] = 1;
    SpawnPlayer(playerid);
    format(tmp2, sizeof(tmp2), "~w~Willkommen ~n~~y~ %s", SpielerName);
    DateProp(playerid);
    GameTextForPlayer(playerid, tmp2, 5000, 1);
    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_INPUT,"Login","Das war das falsche Passwort.\nBitte log dich nun mit dem richtigen Passwort ein:","Bestätigen","Abbrechen");
    return 1;
    }
    }
    }
    else
    {
    Kick(playerid); //Wenn auf Abbrechen geklickt wurde, wird der Spieler gekickt damit man ohne Account nicht Spielen kann.
    }
    }


    Leider nicht eingerückt, Sorry!

  • Kommt das "Willkommen Spielername noch?"

    Nur wenn man das Unmögliche versucht kann man das absolut Mögliche erreichen
    Hermann Hesse


    „Was manche Menschen sich selber vormachen, das macht ihnen so schnell keiner nach.”
    Gerhard Uhlenbruck

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