Dini Fehler!!!

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
  • kk:
    Abspeichern:
    stock Speichern(playerid)
    {
    new Datei[256];
    format(Datei,sizeof(Datei),"/User/%s.cfg",SpielerName(playerid));
    SetPVarInt(playerid,"Verheiratetmit",dini_Int(Datei,"Verheiratetmit"));
    SetPVarInt(playerid,"SFPass",dini_Int(Datei,"SFPass"));
    SetPVarInt(playerid,"LVPass",dini_Int(Datei,"LVPass"));
    SetPVarInt(playerid,"Fraksperre",dini_Int(Datei,"Fraksperre"));
    SetPVarInt(playerid,"KnastZeit",dini_Int(Datei,"KnastZeit"));
    SetPVarInt(playerid,"Knast",dini_Int(Datei,"Knast"));
    SetPVarInt(playerid,"Kredit",dini_Int(Datei,"Kredit"));
    SetPVarInt(playerid,"Bank",dini_Int(Datei,"Bank"));
    SetPVarInt(playerid,"Bankkarte",dini_Int(Datei,"Bankkarte"));
    SetPVarInt(playerid,"Verheiratet",dini_Int(Datei,"Verheiratet"));
    SetPVarInt(playerid,"Handynummer",dini_Int(Datei,"Handynummer"));
    SetPVarInt(playerid,"Tutorial",dini_Int(Datei,"Tutorial"));
    SetPVarInt(playerid,"Telefonbuch",dini_Int(Datei,"Telefonbuch"));
    SetPVarInt(playerid,"Respekt",dini_Int(Datei,"Respekt"));
    SetPVarInt(playerid,"Supporter",dini_Int(Datei,"Supporter"));
    SetPVarInt(playerid,"VIP",dini_Int(Datei,"VIP"));
    SetPVarInt(playerid,"Admin",dini_Int(Datei,"Admin"));
    SetPVarInt(playerid,"Vertrag",dini_Int(Datei,"Vertrag"));
    SetPVarInt(playerid,"Guthaben",dini_Int(Datei,"Guthaben"));
    SetPVarInt(playerid,"Handy",dini_Int(Datei,"Handy"));
    SetPVarInt(playerid,"Mats",dini_Int(Datei,"Mats"));
    SetPVarInt(playerid,"Job",dini_Int(Datei,"Job"));
    SetPVarInt(playerid,"Perso",dini_Int(Datei,"Perso"));
    SetPVarInt(playerid,"Skin",GetPlayerSkin(playerid));
    SetPVarInt(playerid,"Rang",dini_Int(Datei,"Rang"));
    SetPVarInt(playerid,"Member",dini_Int(Datei,"Member"));
    SetPVarInt(playerid,"Leader",dini_Int(Datei,"Leader"));
    SetPVarInt(playerid,"Geschlecht",dini_Int(Datei,"Geschlecht"));
    SetPVarInt(playerid,"Level",GetPlayerScore(playerid));
    SetPVarInt(playerid,"Geld",GetMoney(playerid));
    SetPVarInt(playerid,"Haus",dini_Int(Datei,"Haus"));
    SetPVarInt(playerid,"Bizz",dini_Int(Datei,"Bizz"));
    SetPVarInt(playerid,"Zigaretten",dini_Int(Datei,"Zigaretten"));
    SetPVarInt(playerid,"ZigMarke",dini_Int(Datei,"ZigMarke"));
    SetPVarInt(playerid,"Drogen",dini_Int(Datei,"Drogen"));
    SetPVarInt(playerid,"Gramm",dini_Int(Datei,"Gramm"));
    SetPVarInt(playerid,"FSchein",dini_Int(Datei,"FSchein"));
    SetPVarInt(playerid,"MSchein",dini_Int(Datei,"MSchein"));
    SetPVarInt(playerid,"FLSchein",dini_Int(Datei,"FLSchein"));
    SetPVarInt(playerid,"LKSchein",dini_Int(Datei,"LKSchein"));
    SetPVarInt(playerid,"BSchein",dini_Int(Datei,"BSchein"));
    SetPVarInt(playerid,"KHaus",dini_Int(Datei,"KHaus"));
    SetPVarInt(playerid,"WSchein",dini_Int(Datei,"WSchein"));
    SetPVarInt(playerid,"Gemutet",dini_Int(Datei,"Gemutet"));
    SetPVarInt(playerid,"VertragsZeit",dini_Int(Datei,"VertragsZeit"));
    SetPVarInt(playerid,"Verwarnungen",dini_Int(Datei,"Verwarnungen"));
    SetPVarInt(playerid,"Kicks",dini_Int(Datei,"Kicks"));
    SetPVarInt(playerid,"KHZeit",dini_Int(Datei,"KHZeit"));
    SetPVarInt(playerid,"Pin",dini_Int(Datei,"Pin"));
    SetPVarInt(playerid,"Punkte",dini_Int(Datei,"Punkte"));
    SetPVarInt(playerid,"Local",dini_Int(Datei,"Local"));
    SetPVarInt(playerid,"Versicherung",dini_Int(Datei,"Versicherung"));
    return 1;
    }
    Laden:
    stock Laden(playerid)
    {
    new Datei[256];
    format(Datei,sizeof(Datei),"/User/%s.cfg",SpielerName(playerid));
    dini_IntSet(Datei,"BSchein",GetPVarInt(playerid,"BSchein"));
    dini_IntSet(Datei,"LKSchein",GetPVarInt(playerid,"LKSchein"));
    dini_IntSet(Datei,"FLSchein",GetPVarInt(playerid,"FLSchein"));
    dini_IntSet(Datei,"MSchein",GetPVarInt(playerid,"MSchein"));
    dini_IntSet(Datei,"FSchein",GetPVarInt(playerid,"FSchein"));
    dini_IntSet(Datei,"Gramm",GetPVarInt(playerid,"Gramm"));
    dini_IntSet(Datei,"Drogen",GetPVarInt(playerid,"Drogen"));
    dini_IntSet(Datei,"ZigMarke",GetPVarInt(playerid,"ZigMarke"));
    dini_IntSet(Datei,"Zigaretten",GetPVarInt(playerid,"Zigaretten"));
    dini_IntSet(Datei,"Bizz",GetPVarInt(playerid,"Bizz"));
    dini_IntSet(Datei,"Haus",GetPVarInt(playerid,"Haus"));
    GiveMoney(playerid,dini_Int(Datei,"Geld"));
    SetPlayerScore(playerid,dini_Int(Datei,"Level"));
    dini_IntSet(Datei,"Alter",GetPVarInt(playerid,"Alter"));
    dini_IntSet(Datei,"Geschlecht",GetPVarInt(playerid,"Geschlecht"));
    dini_IntSet(Datei,"Leader",GetPVarInt(playerid,"Leader"));
    dini_IntSet(Datei,"Member",GetPVarInt(playerid,"Member"));
    dini_IntSet(Datei,"Rang",GetPVarInt(playerid,"Rang"));
    SetPlayerSkin(playerid,dini_Int(Datei,"Skin"));
    dini_IntSet(Datei,"Perso",GetPVarInt(playerid,"Perso"));
    dini_IntSet(Datei,"Job",GetPVarInt(playerid,"Job"));
    dini_IntSet(Datei,"Mats",GetPVarInt(playerid,"Mats"));
    dini_IntSet(Datei,"Handy",GetPVarInt(playerid,"Handy"));
    dini_IntSet(Datei,"Guthaben",GetPVarInt(playerid,"Guthaben"));
    dini_IntSet(Datei,"Vertrag",GetPVarInt(playerid,"Vertrag"));
    dini_IntSet(Datei,"Admin",GetPVarInt(playerid,"Admin"));
    dini_IntSet(Datei,"VIP",GetPVarInt(playerid,"VIP"));
    dini_IntSet(Datei,"Supporter",GetPVarInt(playerid,"Supporter"));
    dini_IntSet(Datei,"Respekt",GetPVarInt(playerid,"Respekt"));
    dini_IntSet(Datei,"Telefonbuch",GetPVarInt(playerid,"Telefonbuch"));
    dini_IntSet(Datei,"Tutorial",GetPVarInt(playerid,"Tutorial"));
    dini_IntSet(Datei,"Handynummer",GetPVarInt(playerid,"Handynummer"));
    dini_IntSet(Datei,"Verheiratet",GetPVarInt(playerid,"Verheiratet"));
    dini_IntSet(Datei,"Bankkarte",GetPVarInt(playerid,"Bankkarte"));
    dini_IntSet(Datei,"Bank",GetPVarInt(playerid,"Bank"));
    dini_IntSet(Datei,"Kredit",GetPVarInt(playerid,"Kredit"));
    dini_IntSet(Datei,"Knast",GetPVarInt(playerid,"Knast"));
    dini_IntSet(Datei,"KnastZeit",GetPVarInt(playerid,"KnastZeit"));
    dini_IntSet(Datei,"Fraksperre",GetPVarInt(playerid,"Fraksperre"));
    dini_IntSet(Datei,"LVPass",GetPVarInt(playerid,"LVPass"));
    dini_IntSet(Datei,"SFPass",GetPVarInt(playerid,"SFPass"));
    dini_IntSet(Datei,"Verheiratetmit",GetPVarInt(playerid,"Verheiratetmit"));
    dini_IntSet(Datei,"Verwarnungen",GetPVarInt(playerid,"Verwarnungen"));
    dini_IntSet(Datei,"VertragsZeit",GetPVarInt(playerid,"VertragsZeit"));
    dini_IntSet(Datei,"Gemutet",GetPVarInt(playerid,"Gemutet"));
    dini_IntSet(Datei,"WSchein",GetPVarInt(playerid,"WSchein"));
    dini_IntSet(Datei,"KHaus",GetPVarInt(playerid,"KHaus"));
    dini_IntSet(Datei,"KHZeit",GetPVarInt(playerid,"KHZeit"));
    dini_IntSet(Datei,"Kicks",GetPVarInt(playerid,"Kicks"));
    dini_IntSet(Datei,"Pin",GetPVarInt(playerid,"Pin"));
    dini_IntSet(Datei,"Punkte",GetPVarInt(playerid,"Punkte"));
    dini_IntSet(Datei,"Local",GetPVarInt(playerid,"Local"));
    dini_IntSet(Datei,"Versicherung",GetPVarInt(playerid,"Versicherung"));
    new givemoneystring[256];
    format(givemoneystring, sizeof(givemoneystring), "%d Euro", GetPVarInt(playerid,"Geld"));
    TextDrawSetString(moneytextdraw[playerid], givemoneystring);
    Eingeloggt[playerid] = 1;
    return 1;
    }
    noch etwas?
    //Edit hier noch das was im Dialog gespeichert/abgegeben wird:
    switch(dialogid)
    {
    case DIALOG_LOGIN:
    {
    if(response == 1)
    {
    if(strlen(inputtext) < 6 && !IsNumeric(inputtext))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte Logge dich mit dem\nRichtigen Passwort ein","SPAWN","Abbrechen");
    }
    else
    {
    if(strcmp(inputtext,dini_Get(Datei,"Passwort")))
    {
    Laden(playerid);
    }
    }
    }
    else
    {
    Kick(playerid);
    SendClientMessage(playerid,FARBE_GRAU,"Abgebrochen");
    }
    }


    case DIALOG_ANMEL:
    {
    if(response == 1)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Passwort","Bitte gebe dein WunschPasswort ein","Weiter","Abbrechen");
    }
    else
    {
    Kick(playerid);
    SendClientMessage(playerid,FARBE_GRAU,"Abgebrochen");
    }
    }


    case DIALOG_REGISTER:
    {
    if(response == 1)
    {
    if(strlen(inputtext) < 6)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Passwort","Das Passwort muss Mind. 6 Zeichen enthalten","Weiter","Abbrechen");
    }
    else
    {
    SetPVarString(playerid,"Passwort",inputtext);
    dini_Create(Datei);
    ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_LIST,"Geschlecht","Männlich\nWeiblich","Weiter","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    SendClientMessage(playerid,FARBE_GRAU,"Abgebrochen");
    dini_Remove(Datei);
    }
    }


    case DIALOG_REGISTER2:
    {
    if(listitem==0)
    {
    SetPVarInt(playerid,"Geschlecht",1);
    TutTime[playerid] = 1;
    IstImTut[playerid] = 1;
    TogglePlayerControllable(playerid,0);
    new givemoneystring[256];
    SpawnPlayer(playerid);
    Eingeloggt[playerid] = 1;
    format(givemoneystring, sizeof(givemoneystring), "%d Euro", GetPVarInt(playerid,"Geld"));
    TextDrawSetString(moneytextdraw[playerid], givemoneystring);
    }


    if(listitem==1)
    {
    SetPVarInt(playerid,"Geschlecht",2);
    TutTime[playerid] = 1;
    IstImTut[playerid] = 1;
    TogglePlayerControllable(playerid,0);
    new givemoneystring[256];
    SpawnPlayer(playerid);
    Eingeloggt[playerid] = 1;
    format(givemoneystring, sizeof(givemoneystring), "%d Euro", GetPVarInt(playerid,"Geld"));
    TextDrawSetString(moneytextdraw[playerid], givemoneystring);
    }


    if(response==1)
    {
    SetPVarInt(playerid,"Geschlecht",listitem);
    TutTime[playerid] = 1;
    IstImTut[playerid] = 1;
    TogglePlayerControllable(playerid,0);
    new givemoneystring[256];
    SpawnPlayer(playerid);
    Eingeloggt[playerid] = 1;
    format(givemoneystring, sizeof(givemoneystring), "%d Euro", GetPVarInt(playerid,"Geld"));
    TextDrawSetString(moneytextdraw[playerid], givemoneystring);
    }
    else
    {
    Kick(playerid);
    dini_Remove(Datei);
    SendClientMessage(playerid,FARBE_GRAU,"Abgebrochen");
    }
    }
    Falls noch etwas benötigt wird nicht zögern ;)

  • Hmm.. ich würde keine Per-Player-Variablen benutzen.
    Bei mir haben die sich manchmal gelöscht bevor ich sie beim Disconnecten des Spielers speichern konnte.
    Nimm lieber die gute Alte Methode, die meiner Meinung nach auch mehr Übersicht bietet.
    Falls via Filterscripts darauf zugegriffen werden soll, kannst du diese Daten ja zusätzlich noch in PVars setzen.


    An alle die nun den oberen Punkt kritisieren wollen:
    Es kann sein, dass es mit meinem Problem auch an etwas anderem lag, das will ich nicht ausschließen.
    Ausserdem kann es auch sein, das es leute gibt, die PVars für übersichtlicher halten.
    Seht es einfach als Ratschlag, sollte das Problem bei ihm auch auftreten.




    MfG Firer