Geld wird nicht gespeichert aber warum?

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
  • Hallo habe ein problem und zwar wird das geld nicht gechpeichert und ich weiss nicht warum...


    Hier mal die Codes:


    stock Register(playerid,password[])
    {
    new Accounts[64];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Accounts,sizeof(Accounts),"/Accounts/%s.txt",pName);
    dini_Create(Accounts);
    dini_Set(Accounts,"pPasswort",password);
    dini_IntSet(Accounts,"pAdminlevel",0);
    dini_IntSet(Accounts,"pLevel",0);
    dini_IntSet(Accounts,"pFraktion",0);
    dini_IntSet(Accounts,"pTeam",0);
    dini_IntSet(Accounts,"pLeader",0);
    dini_IntSet(Accounts,"pMember",0);
    dini_IntSet(Accounts,"pAlter",0);
    dini_IntSet(Accounts,"pLand",0);
    dini_IntSet(Accounts,"pMoney",0);
    dini_IntSet(Accounts,"pRang",0);
    SendClientMessage(playerid,COLOR_BLUE,"Du hast dich erfolgreich registriert. Dein Account wird erstellt...");
    SpawnPlayer(playerid);
    GivePlayerMoney(playerid,25000);
    return 1;
    }


    stock Login(playerid,password[])
    {
    new Accounts[64];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Accounts,sizeof(Accounts),"/Accounts/%s.txt",pName);
    if(!strcmp(password,dini_Get(Accounts,"pPasswort"),true))
    {
    SendClientMessage(playerid,COLOR_BLUE,"Du hast dich erfolgreich eingeloggt!");
    PlayerLoad(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Das angegebene Passwort ist Falsch! Versuche es erneut!");
    ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Login","{FEFEFE}Dein {FF9600}Account {FEFEFE}wurde in unserer Datenbank gefunden, bitte gebe nun dein Passwort ein und logge dich somit ein.","Login","Abbrechen");
    return 1;
    }
    }


    stock PlayerSave(playerid)
    {
    new Accounts[64];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Accounts,sizeof(Accounts),"/Accounts/%s.txt",pName);
    if(dini_Exists(Accounts))
    {
    dini_IntSet(Accounts,"pAdminlevel",pPlayer[playerid][pAdminlevel]);
    dini_IntSet(Accounts,"pLevel",pPlayer[playerid][pLevel]);
    dini_IntSet(Accounts,"pFraktion",pPlayer[playerid][pFraktion]);
    dini_IntSet(Accounts,"pTeam",pPlayer[playerid][pTeam]);
    dini_IntSet(Accounts,"pLeader",pPlayer[playerid][pLeader]);
    dini_IntSet(Accounts,"pMember",pPlayer[playerid][pMember]);
    dini_IntSet(Accounts,"pAlter",pPlayer[playerid][pAlter]);
    dini_IntSet(Accounts,"pLand",pPlayer[playerid][pLand]);
    dini_IntSet(Accounts,"pMoney",pPlayer[playerid][pMoney]);
    dini_IntSet(Accounts,"pRang",pPlayer[playerid][pRang]);
    }
    return 1;
    }


    stock PlayerLoad(playerid)
    {
    new Accounts[64];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Accounts,sizeof(Accounts),"/Accounts/%s.txt",pName);
    if(dini_Exists(Accounts))
    {
    SetPlayerScore(playerid,dini_Int(Accounts,"Level"));
    pPlayer[playerid][pAdminlevel] = dini_Int(Accounts,"pAdminlevel");
    pPlayer[playerid][pLevel] = dini_Int(Accounts,"pLevel");
    pPlayer[playerid][pFraktion] = dini_Int(Accounts,"pFraktion");
    pPlayer[playerid][pTeam] = dini_Int(Accounts,"pTeam");
    pPlayer[playerid][pLeader] = dini_Int(Accounts,"pLeader");
    pPlayer[playerid][pMember] = dini_Int(Accounts,"pMember");
    pPlayer[playerid][pAlter] = dini_Int(Accounts,"pAlter");
    pPlayer[playerid][pLand] = dini_Int(Accounts,"pLand");
    pPlayer[playerid][pMoney] = dini_Int(Accounts,"pMoney");
    pPlayer[playerid][pRang] = dini_Int(Accounts,"pRang");
    pPlayer[playerid][pLogin] = 1;
    SpawnPlayer(playerid);
    }
    return 1;
    }


    stock PlayerReset(playerid)
    {
    pPlayer[playerid][pAdminlevel] = 0;
    pPlayer[playerid][pLevel] = 0;
    pPlayer[playerid][pFraktion] = 0;
    pPlayer[playerid][pTeam] = 0;
    pPlayer[playerid][pLeader] = 0;
    pPlayer[playerid][pMember] = 0;
    pPlayer[playerid][pAlter] = 0;
    pPlayer[playerid][pLand] = 0;
    pPlayer[playerid][pMoney] = 0;
    pPlayer[playerid][pRang] = 0;
    return 1;
    }


    enum PlayerDaten
    {
    pAdminlevel,
    pLevel,
    pFraktion,
    pTeam,
    pLogin,
    pLeader,
    pMember,
    pAlter,
    pLand,
    pMoney,
    pRang
    };


    Hoffe jemand kann mir helfen. :D

  • PlayerSave
    dini_IntSet(Accounts,"pMoney",pPlayer[playerid][pMoney]);


    zu


    dini_IntSet(Accounts,"pMoney",GetPlayerMoney(playerid));


    PlayerLoad


    pPlayer[playerid][pMoney] = dini_Int(Accounts,"pMoney");


    zu


    SetPlayerMoney(playerid,dini_Int(Accounts,"pMoney"));





    stock SetPlayerMoney(playerid,money)
    {
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid,money);
    return 1;
    }

  • Beitrag von Jeffry ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.